Main Content

tstat

Student'stmean and variance

Description

example

[m,v] = tstat(nu)returns the mean and variance of the Student'stdistribution withnudegrees of freedom.

Examples

collapse all

Compute the mean and variance for Student'stdistribution with degrees of freedomnuequal to1to30.

nu = reshape(1:30,6,5); [m,v] = tstat(nu)
m =6×5NaN 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
v =6×5NaN 1.4000 1.1818 1.1176 1.0870 NaN 1.3333 1.1667 1.1111 1.0833 3.0000 1.2857 1.1538 1.1053 1.0800 2.0000 1.2500 1.1429 1.1000 1.0769 1.6667 1.2222 1.1333 1.0952 1.0741 1.5000 1.2000 1.1250 1.0909 1.0714

Note that the mean is undefined for1degree of freedom, and variance is undefined for1and2degrees of freedom.

Input Arguments

collapse all

Degrees of freedom for the Student'stdistribution, specified as a positive scalar value or an array of positive scalar values.

Example:[9,19,49,99]

Data Types:single|double

Output Arguments

collapse all

Mean of the Student'stdistribution with the degrees of freedom specified innu, returned as a scalar value or an array of scalar values.mis the same size asnu.

Variance of the Student'stdistribution with the degrees of freedom specified innu, returned as a scalar value or an array of scalar values.vis the same size asnu.

More About

collapse all

Mean and Variance of Student’stDistribution

The parameters of the Student'stdistribution depend on the degrees of freedom.

The mean of the Student’stdistribution isμ= 0for degrees of freedomνgreater than 1. Ifνequals 1, then the mean is undefined.

The variance of the Student’stdistribution is ν ν 2 for degrees of freedomνgreater than 2. Ifνis less than or equal to 2, then the variance is undefined.

For more information, seeStudent's t Distribution.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

版本历史

Introduced before R2006a