Contenuto principale

ncx2inv

Noncentral chi-square inverse cumulative distribution function

Description

x = ncx2inv(p,nu,delta) returns the inverse cumulative distribution function (icdf) of the noncentral chi-square distribution with nu degrees of freedom and the noncentrality parameter delta, evaluated at the probability values in p.

ncx2inv uses Newton's method to converge to the solution.

example

Examples

collapse all

Compute the inverse cdf (icdf) values evaluated at the probability values in p for the noncentral chi-square distribution with nu degrees of freedom and the noncentrality parameter delta.

p = 0.005:0.01:0.995;
nu = 6;
delta = 5;
x = ncx2inv(p,nu,delta);

Plot the icdf.

plot(p,x)
grid on
xlabel("p");
ylabel("x");

Figure contains an axes object. The axes object with xlabel p, ylabel x contains an object of type line.

Input Arguments

collapse all

Probability values at which to evaluate the inverse of the cdf (icdf), specified as a scalar value or an array of scalar values in the range [0,1].

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify nu and delta using arrays. If one or more of the input arguments p, nu, and delta are arrays, then the array sizes must be the same. In this case, ncx2inv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in nu and delta, evaluated at the corresponding element in p.

Data Types: single | double

Degrees of freedom, specified as a positive scalar or an array of positive scalars.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify nu and delta using arrays. If one or more of the input arguments p, nu, and delta are arrays, then the array sizes must be the same. In this case, ncx2inv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in nu and delta, evaluated at the corresponding element in p.

Data Types: single | double

Noncentrality parameter, specified as a nonnegative scalar or an array of nonnegative scalars.

To evaluate the icdf at multiple values, specify p using an array. To evaluate the icdfs of multiple distributions, specify nu and delta using arrays. If one or more of the input arguments p, nu, and delta are arrays, then the array sizes must be the same. In this case, ncx2inv expands each scalar input into a constant array of the same size as the array inputs. Each element in x is the icdf value of the distribution specified by the corresponding elements in nu and delta, evaluated at the corresponding element in p.

Data Types: single | double

Output Arguments

collapse all

Inverse cdf values evaluated at the probabilities in p, returned as a scalar value or an array of scalar values. x is the same size as p, nu, and delta after any necessary scalar expansion. Each element in x is the inverse cdf value of the distribution specified by the corresponding elements in nu and delta, evaluated at the corresponding probability in p.

Alternative Functionality

  • ncx2inv is a function specific to the noncentral chi-square distribution. Statistics and Machine Learning Toolbox™ also offers the generic function icdf, which supports various probability distributions. To use icdf, specify the probability distribution name and its parameters. Note that the distribution-specific function ncx2inv is faster than the generic function icdf.

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

Version History

Introduced before R2006a

expand all