({{, (RefLink[StudentTDistribution, paclet:ref/StudentTDistribution])[ν] 
represents a Student t distribution with ν degrees of freedom.}, {, (RefLink[StudentTDistribution, paclet:ref/StudentTDistribution])[μ,σ,ν]
represents a Student t distribution with location parameter μ, scale parameter σ, and ν degrees of freedom.}})

OpenersNotesSection(Spacer1)Details

The probability density for value x in a Student t distribution with ν degrees of freedom is proportional to (((ν/(ν+(x^2))))^((1+ν)/2)). »

With location parameter μ and scale σ, (x-μ)/σ follows a standard Student t distribution with ν degrees of freedom.

For integer ν, the Student t distribution gives the distribution of the deviation from the true mean of the observed mean for a sample of ν values from a normal distribution, normalized by standard deviation of the sample.

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]) allows μ to be any real number and σ and ν to be any positive real numbers.

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]) allows μ and σ to be any quantities of the same unit dimension, and ν to be any dimensionless quantity. »

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]) can be used with such functions as (RefLink[Mean, paclet:ref/Mean]), (RefLink[CDF, paclet:ref/CDF]), and (RefLink[RandomVariate, paclet:ref/RandomVariate]). »

OpenersPrimaryExamplesSection(Spacer1)Examples  (37)

OpenersExampleSection0(Spacer1)Basic Examples  (8)

Probability density function:

Plot[Table[PDF[StudentTDistribution[ν],x],{ν,{0.1,0.5,4}}]//Evaluate,{x,-5,5},Filling->Axis]

PDF[StudentTDistribution[ν],x]

Cumulative distribution function:

Plot[Table[CDF[StudentTDistribution[ν],x],{ν,{0.1,0.5,4}}]//Evaluate,{x,-5,5},Filling->Axis,Exclusions->None]

CDF[StudentTDistribution[ν],x]

Mean and variance:

Mean[StudentTDistribution[ν]]

Variance[StudentTDistribution[ν]]

Median:

Median[StudentTDistribution[ν]]

Probability density function of a generalized Student t distribution:

Plot[Table[PDF[StudentTDistribution[1,2,ν],x],{ν,{0.1,0.5,4}}]//Evaluate,{x,-3,5},Filling->Axis]

PDF[StudentTDistribution[μ,σ,ν],x]

Cumulative distribution function of a generalized Student t distribution:

Plot[Table[CDF[StudentTDistribution[1,2,ν],x],{ν,{0.1,0.5,4}}]//Evaluate,{x,-3,5},Filling->Axis,Exclusions->None]

CDF[StudentTDistribution[μ,σ,ν],x]

Mean and variance of a generalized Student t distribution:

Mean[StudentTDistribution[μ,σ,ν]]

Variance[StudentTDistribution[μ,σ,ν]]

Median of a generalized Student t distribution:

Median[StudentTDistribution[μ,σ,ν]]

OpenersExampleSection1(Spacer1)Scope  (8)

Generate a sample of pseudorandom numbers from a Student t distribution:

data=RandomVariate[StudentTDistribution[10],10^4];

Compare its histogram to the PDF:

Show[
Histogram[data,20,"PDF"],
Plot[PDF[StudentTDistribution[10],x],{x,-4,4},PlotStyle->Thick]]

Distribution parameters estimation:

sample=RandomVariate[StudentTDistribution[8],10^3];

Estimate the distribution parameters from sample data:

edist=EstimatedDistribution[sample, StudentTDistribution[ν]]

Compare the density histogram of the sample with the PDF of the estimated distribution:

Show[Histogram[sample,Automatic,"PDF"],Plot[PDF[edist,x],{x,-4,4},PlotStyle->Thick]]

A Student t distribution is symmetric and hence skewness is 0 if defined:

Skewness[StudentTDistribution[ν]]

Skewness[StudentTDistribution[μ,σ,ν]]

Kurtosis:

Plot[Kurtosis[StudentTDistribution[ν]],{ν,4,10},Filling->Axis]

Kurtosis[StudentTDistribution[ν]]

Adding scale and location parameters does not change the kurtosis:

Kurtosis[StudentTDistribution[μ,σ,ν]]==Kurtosis[StudentTDistribution[ν]]//FullSimplify

In the limit, kurtosis is the same as for (RefLink[NormalDistribution, paclet:ref/NormalDistribution]):

Limit[Kurtosis[StudentTDistribution[ν]],ν->∞]

Different moments with closed forms as functions of parameters:

FormulaGrid[list_,type_]:=Grid[Transpose[{list}],Alignment->{Left,Automatic},Background->{None,{{Lighter[Blend[Switch[type,M,{Blue,Green},CM,{Red,Orange},FM,{Magenta,Cyan},C,{Purple,Red}]],.8],White}}},Dividers->{None,{Darker[Gray,.6],{False},Darker[Gray,.6]}},ItemSize->30]

(RefLink[Moment, paclet:ref/Moment]):

FormulaGrid[Table[Moment[StudentTDistribution[ν],k],{k,5}],M]

Closed form for symbolic order:

Moment[StudentTDistribution[ν],r]

(RefLink[Moment, paclet:ref/Moment]) for generalized Student t distribution:

FormulaGrid[Table[Moment[StudentTDistribution[μ,σ,ν],k],{k,3}],M]

(RefLink[CentralMoment, paclet:ref/CentralMoment]):

FormulaGrid[Table[CentralMoment[StudentTDistribution[ν],k],{k,5}],CM]

Closed form for symbolic order:

CentralMoment[StudentTDistribution[ν],r]

(RefLink[CentralMoment, paclet:ref/CentralMoment]) for generalized Student t distribution:

FormulaGrid[Table[CentralMoment[StudentTDistribution[μ,σ,ν],k],{k,3}],CM]

Closed form for symbolic order:

CentralMoment[StudentTDistribution[μ,σ,ν],r]

(RefLink[FactorialMoment, paclet:ref/FactorialMoment]):

FormulaGrid[Table[FactorialMoment[StudentTDistribution[ν],k],{k,5}],FM]

(RefLink[FactorialMoment, paclet:ref/FactorialMoment]) for generalized Student t distribution:

FormulaGrid[Table[FactorialMoment[StudentTDistribution[μ,σ,ν],k],{k,3}],FM]

(RefLink[Cumulant, paclet:ref/Cumulant]):

FormulaGrid[Table[Cumulant[StudentTDistribution[ν],k],{k,5}],C]

(RefLink[Cumulant, paclet:ref/Cumulant]) for generalized Student t distribution:

FormulaGrid[Table[Cumulant[StudentTDistribution[μ,σ,ν],k],{k,3}],C]

Hazard function:

Plot[Table[HazardFunction[StudentTDistribution[ν],x],{ν,{1,5,10}}]//Evaluate,{x,-3,10},Filling->Axis,Exclusions->None]

HazardFunction[StudentTDistribution[ν],x]

For generalized Student t distribution:

Plot[Table[HazardFunction[StudentTDistribution[-1,σ,2],x],{σ,{1,2,5}}]//Evaluate,{x,-5,10},Filling->Axis,Exclusions->None]

Plot[Table[HazardFunction[StudentTDistribution[μ,.7,.4],x],{μ,{-1,2,5}}]//Evaluate,{x,-5,10},Filling->Axis,PlotRange->All,Exclusions->None]

Quantile function:

Plot[Table[Quantile[StudentTDistribution[ν],q],{ν,{1,2,4}}]//Evaluate,{q,0,1},Filling->Axis]

Quantile[StudentTDistribution[ν],q]

For generalized Student t distribution:

Plot[Table[Quantile[StudentTDistribution[1,σ,3],q],{σ,{1,2,4}}]//Evaluate,{q,0,1},Filling->Axis]

Quantile[StudentTDistribution[μ,σ,ν],q]

Consistent use of (RefLink[Quantity, paclet:ref/Quantity]) in parameters yields (RefLink[QuantityDistribution, paclet:ref/QuantityDistribution]):

pos𝒟=StudentTDistribution[(Quantity[2, "m", meters, "Meters"]),(Quantity[3.5, "cm", centimeters, "Centimeters"]),5]

Find quartiles:

Quartiles[pos𝒟]

OpenersExampleSection2(Spacer1)Applications  (2)

Compute p-values for a t-test with n degrees of freedom and alternative hypothesis X<t:

CDF[StudentTDistribution[n],t]

Alternative hypothesis X>t:

1-CDF[StudentTDistribution[n],t]//PiecewiseExpand

Alternative hypothesis (Abs[X])>(Abs[t]):

2 CDF[StudentTDistribution[n],-Abs[t]]//PiecewiseExpand

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]) is used in exact (small) sampling theory. Define t-statistics:

tStatistics[data_,μ_]:=(Mean[data]-μ)/(StandardDeviation[data]/(Sqrt[Length[data]]))

If data comes from a normal distribution, then the t-statistics follow a (RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]), even for data that is a sample of small size (less than 30):

With[{N=20},Show[Histogram[Table[tStatistics[RandomVariate[NormalDistribution[],N],0],{i,10^3}],20,"PDF"],Plot[PDF[StudentTDistribution[N-1],x],{x,-3.5,3.5},PlotStyle->Thick]]]

OpenersExampleSection3(Spacer1)Properties & Relations  (16)

Student t distribution is closed under translation and scaling by a positive factor:

TransformedDistribution[k*u+loc,u\[Distributed]StudentTDistribution[μ,σ,ν]]

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution])[ν] converges to a normal distribution as ν->∞:

{μ,σ}={Mean[StudentTDistribution[ν]],StandardDeviation[StudentTDistribution[ν]]}

Table[Plot[{PDF[StudentTDistribution[ν],x],PDF[NormalDistribution[μ,σ],x]}//Evaluate,{x,μ-2σ,μ+2σ},AxesOrigin->{μ-3σ,0},Ticks->{{{μ-2σ,HoldForm[μ-2σ]},{μ,HoldForm[μ]},{μ+2σ,HoldForm[μ+2σ]}},Automatic},PlotLabel->ν],{ν,{5,10,25,100}}]

Relationships to other distributions:

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution])[ν] has location μ=0 and scale σ=1:

PDF[StudentTDistribution[ν],x]

PDF[StudentTDistribution[0,1,ν],x]

%-%%

The two forms are related by a change of variable:

TransformedDistribution[u σ+μ,u\[Distributed]StudentTDistribution[ν]]

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution])[1] is equivalent to (RefLink[CauchyDistribution, paclet:ref/CauchyDistribution])[0,1]:

PDF[StudentTDistribution[1],x]

PDF[CauchyDistribution[0,1],x]

%-%%

The Student t distribution converges to the standard (RefLink[NormalDistribution, paclet:ref/NormalDistribution]) as ν tends to infinity:

Limit[PDF[StudentTDistribution[ν],x],ν->∞]

PDF[NormalDistribution[0,1],x]

%-%%

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]) is a (RefLink[NoncentralStudentTDistribution, paclet:ref/NoncentralStudentTDistribution]) with noncentrality 0:

PDF[NoncentralStudentTDistribution[ν,0],x]

PDF[StudentTDistribution[ν],x]//FunctionExpand

FullSimplify[%-%%,ν>0&&x∈Reals]

A square of a Student t distributed variable has (RefLink[FRatioDistribution, paclet:ref/FRatioDistribution]):

TransformedDistribution[x^2,x\[Distributed]StudentTDistribution[ν]]

An inverse square of Student t distributed variable has (RefLink[FRatioDistribution, paclet:ref/FRatioDistribution]):

TransformedDistribution[ (1/(z^2)),z\[Distributed]StudentTDistribution[ν]]

Student t distribution is a special case of type 4 and type 7 (RefLink[PearsonDistribution, paclet:ref/PearsonDistribution]):

p4=PDF[PearsonDistribution[4,1,0,(1/(ν+1)),0,(ν/(1+ν))],x]//FullSimplify[#,ν>0]&

p7=PDF[PearsonDistribution[7,1,0,(1/(ν+1)),0,(ν/(1+ν))],x]//FullSimplify

PDF[StudentTDistribution[ν],x]//PowerExpand//FullSimplify

{p4-%,p7-%}

Generalized Student t distribution is a special case of type 4 and type 7 (RefLink[PearsonDistribution, paclet:ref/PearsonDistribution]):

p4=PDF[PearsonDistribution[4,1,-μ,(1/(ν+1)),-((2 μ)/(ν+1)),(((μ^2)+ν (σ^2))/(ν+1))],x]//FullSimplify[#,ν>0&&σ>0]&

p7=PDF[PearsonDistribution[7,1,-μ,(1/(ν+1)),-((2 μ)/(ν+1)),(((μ^2)+ν (σ^2))/(ν+1))],x]//FullSimplify

PDF[StudentTDistribution[μ,σ,ν],x]//FullSimplify//PowerExpand

{p4-%,p7-%}//FullSimplify[#,ν>0&&σ>0]&

Student t distribution can be obtained from (RefLink[ChiSquareDistribution, paclet:ref/ChiSquareDistribution]):

𝒟=TransformedDistribution[1/2 (Sqrt[ν])(u-v)/(Sqrt[u v ]),{u,v}\[Distributed]ProductDistribution[{ChiSquareDistribution[ν],2}]];

Block[{ν=14},Show[Histogram[RandomVariate[𝒟,10^4],25,"PDF"],Plot[PDF[StudentTDistribution[ν],x],{x,-4,4},PlotStyle->Thick]]]

Student t distribution can be obtained from (RefLink[NormalDistribution, paclet:ref/NormalDistribution]) and (RefLink[ChiSquareDistribution, paclet:ref/ChiSquareDistribution]):

𝒟=TransformedDistribution[z (Sqrt[ν /w]),{z\[Distributed]NormalDistribution[],w\[Distributed]ChiSquareDistribution[ν]}];

PDF[𝒟,x]//FullSimplify[#,ν>0]&

PDF[StudentTDistribution[ν],x]//FunctionExpand//PowerExpand

FullSimplify[%-%%,x≠0]

Student t distribution is a parameter mixture of a (RefLink[NormalDistribution, paclet:ref/NormalDistribution]) with (RefLink[GammaDistribution, paclet:ref/GammaDistribution]):

ParameterMixtureDistribution[NormalDistribution[μ,1/Sqrt[p]],p\[Distributed]GammaDistribution[α,β]]

Marginals of (RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution]) with identity scale matrix are Student t distributions:

𝒟=MarginalDistribution[MultivariateTDistribution[{{1,0},{0,1}},ν],1];

PDF[𝒟,x]

PDF[StudentTDistribution[ν],x]

FullSimplify[%-%%,ν>0&&x∈Reals]

Central moments of two Student t distributions are proportional when defined:

(σ^r)Refine[CentralMoment[StudentTDistribution[ν],r],0≤r<ν]//PiecewiseExpand[#,σ>0]&

Refine[CentralMoment[StudentTDistribution[μ,σ,ν],r],0≤r<ν]

%/%%//FullSimplify[#,Mod[r,2]==0]&

OpenersExampleSection4(Spacer1)Possible Issues  (2)

(RefLink[StudentTDistribution, paclet:ref/StudentTDistribution]) is not defined when ν is a not a positive real number:

Mean[StudentTDistribution[3+I]]

Substitution of invalid parameters into symbolic outputs gives results that are not meaningful:

Variance[StudentTDistribution[ν]]/.{ν->2I}

OpenersExampleSection5(Spacer1)Neat Examples  (1)

PDFs for different ν values with CDF contours:

cdf=Function[{x,ν},Evaluate[CDF[StudentTDistribution[ν],x]]];
ql={0.025,0.10,0.25,0.5,0.75,0.90,0.975};
cl=Table[ColorData["Rainbow"][q],{q,Join[{0.0},ql]}];

Legended[Plot3D[PDF[StudentTDistribution[ν],x],{x,-6,6},{ν,1,5},PlotTheme->"Marketing",MeshFunctions->{cdf},Mesh->{ql},MeshStyle->GrayLevel[0.8],MeshShading->cl,AxesLabel->Automatic,PlotPoints->35,BaseStyle->Opacity[0.9],ImageSize->400,PlotRange->{0,1/2}],BarLegend["Rainbow",ql,LegendLabel->"prob"]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[MultivariateTDistribution, paclet:ref/MultivariateTDistribution])  ▪  (RefLink[NormalDistribution, paclet:ref/NormalDistribution])  ▪  (RefLink[ChiSquareDistribution, paclet:ref/ChiSquareDistribution])  ▪  (RefLink[NoncentralStudentTDistribution, paclet:ref/NoncentralStudentTDistribution])  ▪  (RefLink[CauchyDistribution, paclet:ref/CauchyDistribution])  ▪  (RefLink[HotellingTSquareDistribution, paclet:ref/HotellingTSquareDistribution])  ▪  (RefLink[Beta, paclet:ref/Beta])  ▪  (RefLink[BetaRegularized, paclet:ref/BetaRegularized])  ▪  (RefLink[InverseBetaRegularized, paclet:ref/InverseBetaRegularized])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Continuous Distributions, paclet:tutorial/ContinuousDistributions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Normal and Related Distributions, paclet:guide/NormalRelatedDistributions])}, {▪(RefLinkPlain[Parametric Statistical Distributions, paclet:guide/ParametricStatisticalDistributions])}, {▪(RefLinkPlain[Functions Used in Statistics, paclet:guide/FunctionsUsedInStatistics])}, {▪(RefLinkPlain[Heavy Tail Distributions, paclet:guide/HeavyTailDistributions])}})}})