Main Content

fstat

F mean and variance

Description

m = fstat(nu1,nu2) returns the mean of the F distribution with nu1 numerator degrees of freedom and nu2 denominator degrees of freedom.

[m,v] = fstat(nu1,nu2) also returns the variance for the distribution.

example

Examples

collapse all

Compute the mean and variance of an F distribution with nu1 numerator degrees of freedom and nu2 denominator degrees of freedom.

nu1 = 5;
nu2 = 10;
[mean,variance] = fstat(nu1,nu2)
mean = 
1.2500
variance = 
1.3542

Input Arguments

collapse all

Numerator degrees of freedom, specified as a positive scalar value or an array of positive scalar values. If both nu1 and nu2 are arrays, they must be the same size. If either nu1 or nu2 is a scalar, then fstat expands the scalar argument into a constant array of the same size as the other argument.

Data Types: single | double

Denominator degrees of freedom, specified as a positive scalar value or an array of positive scalar values. If both nu1 and nu2 are arrays, they must be the same size. If either nu1 or nu2 is a scalar, then fstat 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 F distribution, returned as a numeric scalar or an array of numeric scalars. m is the same size as nu1 and nu2. Each element in m is the mean of the F distribution specified by the corresponding elements in nu1 and nu2. If nu1(i) or nu2(i) is less than or equal to zero, then m(i) is NaN.

The mean of the F distribution for values of ν2 greater than 2 is

ν2ν22

Variance for the F distribution, returned as a numeric scalar or an array of numeric scalars. v is the same size as nu1 and nu2. Each element in v is the variance of the F distribution specified by the corresponding elements in nu1 and nu2. If nu1(i) or nu2(i) is less than or equal to zero, then v(i) is NaN.

The variance of the F distribution for values of ν2 greater than 4 is

2ν22(ν1+ν22)ν1(ν22)2(ν24)

Extended Capabilities

expand all

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

Version History

Introduced before R2006a

See Also

| | |