Contenuto principale

ncx2stat

Noncentral chi-square mean and variance

Description

m = ncx2stat(nu,delta) returns the mean for the noncentral chi-square distribution with nu degrees of freedom and the noncentrality parameter delta.

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

example

Examples

collapse all

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

nu = 5;
delta = 3;
[mean,variance] = ncx2stat(nu,delta)
mean = 
8
variance = 
22

Input Arguments

collapse all

Degrees of freedom, specified as a nonnegative scalar or an array of nonnegative scalars. If both nu and delta are arrays, they must be the same size. If either nu or delta is a scalar, then ncx2stat 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 nonnegative scalar or an array of nonnegative scalars. If both nu and delta are arrays, they must be the same size. If either nu or delta is a scalar, then ncx2stat 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 chi-square 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 chi-square distribution specified by the corresponding elements in nu and delta.

The mean of the noncentral chi-square distribution with parameters ν and δ is ν+δ.

Variance for the noncentral chi-square 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 chi-square distribution specified by the corresponding elements in nu and delta.

The variance of the noncentral chi-square distribution with parameters ν and δ is 2(ν+2δ).

References

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

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

Extended Capabilities

expand all

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

Version History

Introduced before R2006a

expand all