F distribution probability density function (PDF).
The probability density function (PDF) for a F random variable is
where d1 is the numerator degrees of freedom and d2 is the denominator degrees of freedom and B is the Beta function.
var pdf = require( '@stdlib/stats/base/dists/f/pdf' );Evaluates the probability density function (PDF) for a F distribution with parameters d1 (numerator degrees of freedom) and d2 (denominator degrees of freedom).
var y = pdf( 2.0, 0.5, 1.0 );
// returns ~0.057
y = pdf( 0.1, 1.0, 1.0 );
// returns ~0.915
y = pdf( -1.0, 4.0, 2.0 );
// returns 0.0If provided NaN as any argument, the function returns NaN.
var y = pdf( NaN, 1.0, 1.0 );
// returns NaN
y = pdf( 0.0, NaN, 1.0 );
// returns NaN
y = pdf( 0.0, 1.0, NaN );
// returns NaNIf provided d1 <= 0, the function returns NaN.
var y = pdf( 2.0, 0.0, 1.0 );
// returns NaN
y = pdf( 2.0, -1.0, 1.0 );
// returns NaNIf provided d2 <= 0, the function returns NaN.
var y = pdf( 2.0, 1.0, 0.0 );
// returns NaN
y = pdf( 2.0, 1.0, -1.0 );
// returns NaNReturns a function for evaluating the PDF of an F distribution with parameters d1 (numerator degrees of freedom) and d2 (denominator degrees of freedom).
var mypdf = pdf.factory( 6.0, 7.0 );
var y = mypdf( 7.0 );
// returns ~0.004
y = mypdf( 2.0 );
// returns ~0.166var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var pdf = require( '@stdlib/stats/base/dists/f/pdf' );
var opts = {
'dtype': 'float64'
};
var x = uniform( 10, 0.0, 4.0, opts );
var d1 = uniform( 10, 0.0, 10.0, opts );
var d2 = uniform( 10, 0.0, 10.0, opts );
logEachMap( 'x: %0.4f, d1: %0.4f, d2: %0.4f, f(x;d1,d2): %0.4f', x, d1, d2, pdf );