Documentation

ncx2cdf

Noncentral chi-square cumulative distribution function

Syntax

p = ncx2cdf(x,v,delta)
p = ncx2cdf(x,v,delta,'upper')

Description

p = ncx2cdf(x,v,delta)computes the noncentral chi-square cdf at each value inxusing the corresponding degrees of freedom invand positive noncentrality parameters indelta.x,v, anddeltacan be vectors, matrices, or multidimensional arrays that all have the same size, which is also the size ofp. A scalar input forx,v, ordeltais expanded to a constant array with the same dimensions as the other inputs.

p = ncx2cdf(x,v,delta,'upper')returns the complement of the noncentral chi-square cdf at each value inx, using an algorithm that more accurately computes the extreme upper tail probabilities.

Some texts refer to this distribution as the generalized Rayleigh, Rayleigh-Rice, or Rice distribution.

The noncentral chi-square cdf is

F ( x | ν , δ ) = j = 0 ( ( 1 2 δ ) j j ! e δ 2 ) Pr [ χ ν + 2 j 2 x ]

Examples

collapse all

Compare the noncentral chi-square cdf withDELTA = 2to the chi-square cdf with the same number of degrees of freedom (4):

x = (0:0.1:10)'; ncx2 = ncx2cdf(x,4,2); chi2 = chi2cdf(x,4); plot(x,ncx2,'b-','LineWidth',2) holdonplot(x,chi2,'g--','LineWidth',2) legend('ncx2','chi2','Location','NW')

References

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

Extended Capabilities

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

Introduced before R2006a

Was this topic helpful?