Main Content

chi2stat

Chi-square mean and variance

Description

m = chi2stat(nu) returns the mean for the chi-square distribution with nu degrees of freedom.

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

example

Examples

collapse all

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

nu = 5;
[mean,variance] = chi2stat(nu)
mean = 
5
variance = 
10

Input Arguments

collapse all

Degrees of freedom for the chi-square distribution, specified as a positive scalar value or an array of positive scalar values.

Data Types: single | double

Output Arguments

collapse all

Mean for the chi-square distribution, returned as a numeric scalar or an array of numeric scalars. m is the same size as nu. Each element in m is the mean of the chi-square distribution specified by the corresponding element in nu.

The mean of the chi-square distribution is nu.

Variance for the chi-square distribution, returned as a numeric scalar or an array of numeric scalars. v is the same size as nu. Each element in v is the variance of the chi-square distribution specified by the corresponding element in nu.

The variance of the chi-square distribution is 2nu.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a