<< distfun_ncx2cdf Noncentral Chi-Squared distfun_ncx2pdf >>

distfun >> distfun > Noncentral Chi-Squared > distfun_ncx2inv

distfun_ncx2inv

Noncentral Chi-Squared Inverse CDF

Calling Sequence

x = distfun_ncx2cdf(p,k,delta)
x = distfun_ncx2cdf(p,k,delta,lowertail)

Parameters

p :

a matrix of doubles, the probability.

k :

a matrix of doubles, the number of degrees of freedom, k>0 (can be non integer)

delta :

a matrix of doubles, the noncentrality parameter, delta>=0

lowertail :

a 1-by-1 matrix of booleans, the tail (default lowertail=%t). If lowertail is true (the default), then considers P(X<=x) otherwise P(X>x).

x :

a matrix of doubles, the outcome. x belongs to the set {0,1,2,3,......}

Description

Computes the Inverse cumulative distribution function of the Noncentral Chi-Squared distribution function.

Any scalar input argument is expanded to a matrix of doubles of the same size as the other input arguments.

Caution This distribution is known to have inferior accuracy in some cases.

Examples

// Test with p scalar, k scalar
computed = distfun_ncx2inv(0.4,5)
expected = 3.6554996

// Test with expanded p, k scalar
computed = distfun_ncx2inv([0.2 0.6],5)
expected = [2.3425343 5.1318671]

// Test with p scalar, k expanded
computed = distfun_ncx2inv(0.44,[4 7])
expected = [2.9870195 5.827751]

// Test with both p,k expanded
computed = distfun_ncx2inv([0.22 0.66],[3 4])
expected = [1.0878828 4.5215487]

// Test small values of p
x = distfun_ncx2inv(1.e-15,6)
expected = 0.0000363
x = distfun_ncx2inv(1.e-15,6,%f)
expected = 82.67507

Bibliography

http://en.wikipedia.org/wiki/Noncentral_chi-squared_distribution

Authors


Report an issue
<< distfun_ncx2cdf Noncentral Chi-Squared distfun_ncx2pdf >>