Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# tstat

Student's t mean and variance

## Syntax

[M,V] = tstat(NU)

## Description

[M,V] = tstat(NU) returns the mean of and variance for Student's t distribution using the degrees of freedom in NU. M and V are the same size as NU.

The mean of the Student's t distribution with parameter ν is zero for values of ν greater than 1. If ν is one, the mean does not exist. The variance for values of ν greater than 2 is ν/(ν-2).

## Examples

Find the mean of and variance for 1 to 30 degrees of freedom.

```[m,v] = tstat(reshape(1:30,6,5))
m =
NaN  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 =
NaN   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 variance does not exist for one and two degrees of freedom.