Contenido principal

nctstat

Noncentral t mean and variance

Description

m = nctstat(nu,delta) returns the mean for the noncentral t distribution with nu degrees of freedom and the noncentrality parameter delta.

[m,v] = nctstat(nu,delta) also returns the variance for the distribution.

example

Examples

collapse all

Compute the mean and variance of a noncentral t distribution with nu degrees of freedom and the noncentrality parameter delta.

nu = 5;
delta = 3;
[mean,variance] = nctstat(nu,delta)
mean = 
3.5682
variance = 
3.9343

Input Arguments

collapse all

Degrees of freedom, specified as a positive scalar or an array of positive scalars. If both nu and delta are arrays, they must be the same size. If either nu or delta is a scalar, then nctstat expands the scalar argument into a constant array of the same size as the other argument.

Data Types: single | double

Noncentrality parameter, specified as a numeric scalar or array. If both nu and delta are arrays, they must be the same size. If either nu or delta is a scalar, then nctstat expands the scalar argument into a constant array of the same size as the other argument.

Data Types: single | double

Output Arguments

collapse all

Mean for the noncentral t distribution, returned as a numeric scalar or an array of numeric scalars. m is the same size as nu and delta. Each element in m is the mean of the noncentral t distribution specified by the corresponding elements in nu and delta.

The mean of the noncentral t distribution with parameters ν and δ is

δ(ν/2)1/2Γ((ν1)/2)Γ(ν/2)

where ν > 1.

Variance for the noncentral t distribution, returned as a numeric scalar or an array of numeric scalars. v is the same size as nu and delta. Each element in v is the variance of the noncentral tdistribution specified by the corresponding elements in nu and delta.

The variance of the noncentral t distribution is

ν(ν2)(1+δ2)ν2δ2[Γ((ν1)/2)Γ(ν/2)]2

where ν > 2.

References

[1] Evans, M., N. Hastings, and B. Peacock. Statistical Distributions. 2nd ed., Hoboken, NJ: John Wiley & Sons, Inc., 1993, pp. 147–148.

[2] Johnson, N., and S. Kotz. Distributions in Statistics: Continuous Univariate Distributions-2. Hoboken, NJ: John Wiley & Sons, Inc., 1970, pp. 201–219.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a