Categories &

Functions List

Function Reference: ncfinv

statistics: x = ncfinv (p, df1, df2, lambda)

Inverse of the noncentral F-cumulative distribution function (iCDF).

For each element of p, compute the quantile (the inverse of the CDF) of the noncentral F-distribution with df1 and df2 degrees of freedom and noncentrality parameter lambda. The size of x is the common size of p, df1, df2, and lambda. A scalar input functions as a constant matrix of the same size as the other inputs.

ncfinv uses Newton’s method to converge to the solution.

Further information about the noncentral F-distribution can be found at https://en.wikipedia.org/wiki/Noncentral_F-distribution

See also: ncfcdf, ncfpdf, ncfrnd, ncfstat, finv

Source Code: ncfinv

Example: 1

Plot various iCDFs from the noncentral F distribution

 p = 0.001:0.001:0.999;
 x1 = ncfinv (p, 2, 5, 1);
 x2 = ncfinv (p, 2, 5, 2);
 x3 = ncfinv (p, 5, 10, 1);
 x4 = ncfinv (p, 10, 20, 10);
 plot (p, x1, '-r', p, x2, '-g', p, x3, '-k', p, x4, '-m')
 grid on
 ylim ([0, 5])
 legend ({'df1 = 2, df2 = 5, λ = 1', 'df1 = 2, df2 = 5, λ = 2', ...
          'df1 = 5, df2 = 10, λ = 1', 'df1 = 10, df2 = 20, λ = 10'}, ...
         'location', 'northwest')
 title ('Noncentral F iCDF')
 xlabel ('probability')
 ylabel ('values in x')
plotted figure

Example: 2

Compare the noncentral F iCDF with LAMBDA = 10 to the F iCDF with the same number of numerator and denominator degrees of freedom (5, 20)

 p = 0.001:0.001:0.999;
 x1 = ncfinv (p, 5, 20, 10);
 x2 = finv (p, 5, 20);
 plot (p, x1, '-', p, x2, '-');
 grid on
 ylim ([0, 10])
 legend ({'Noncentral F(5,20,10)', 'F(5,20)'}, 'location', 'northwest')
 title ('Noncentral F vs F quantile functions')
 xlabel ('probability')
 ylabel ('values in x')
plotted figure