Categories &

Functions List

Function Reference: finv

statistics: x = finv (p, df1, df2)

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

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

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

Where one degree of freedom is so large against the other that the F-distribution cannot be told from its limit in double precision, the quantile is taken from the limit, chi2inv (p, df1) / df1 as df2 grows and df2 / chi2inv (1 - p, df2) as df1 grows. Once one degree of freedom reaches 10^8 and the other is small, MATLAB returns quantiles whose probability is off by about 3%: its finv (0.025, 10, 1e8) is 0.32227, whose probability is 0.0243, where the quantile is 0.32470.

Input arguments must be double or single; integer, logical, and character arrays are rejected. MATLAB accepts a character array and evaluates it at the character codes, which Octave deliberately does not, since a character array is an integer type and integers are refused too.

See also: fcdf, fpdf, frnd, fstat

Source Code: finv

Plot various iCDFs from the F distribution

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