tstat
Student's t mean and variance
Syntax
Description
Examples
Compute Mean and Variance of Student's t Distribution
Compute the mean and variance for Student's t distribution with degrees of freedom nu equal to 1
to 30
.
nu = reshape(1:30,6,5); [m,v] = tstat(nu)
m = 6×5
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 = 6×5
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 mean is undefined for 1
degree of freedom, and variance is undefined for 1
and 2
degrees of freedom.
Input Arguments
nu
— Degrees of freedom
positive scalar value | array of positive scalar values
Degrees of freedom for the Student's t distribution, specified as a positive scalar value or an array of positive scalar values.
Example: [9,19,49,99]
Data Types: single
| double
Output Arguments
m
— Mean
scalar value | array of scalar values
Mean of the Student's t distribution with the degrees of freedom
specified in nu
, returned as a scalar value or an array of scalar
values. m
is the same size as nu
.
v
— Variance
scalar value | array of scalar values
Variance of the Student's t distribution with the degrees of
freedom specified in nu
, returned as a scalar value or an array of
scalar values. v
is the same size as
nu
.
More About
Mean and Variance of Student’s t Distribution
The parameters of the Student's t distribution depend on the degrees of freedom.
The mean of the Student’s t distribution is μ = 0 for degrees of freedom ν greater than 1. If ν equals 1, then the mean is undefined.
The variance of the Student’s t distribution is for degrees of freedom ν greater than 2. If ν is less than or equal to 2, then the variance is undefined.
For more information, see Student's t Distribution.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced before R2006a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)