diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md index 9322e3a3c92c..aeedb85d557f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/pdf/README.md @@ -143,6 +143,106 @@ logEachMap( 'x: %0.4f, d1: %0.4f, d2: %0.4f, f(x;d1,d2): %0.4f', x, d1, d2, pdf + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/f/pdf.h" +``` + +#### stdlib_base_dists_f_pdf( x, d1, d2 ) + +Evaluates the probability density function (PDF) for an F distribution with numerator degrees of freedom `d1` and denominator degrees of freedom `d2` at a value `x`. + + +```c +double out = stdlib_base_dists_f_pdf( 2.0, 0.5, 1.0 ); +// returns ~0.057 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **d1**: `[in] double` numerator degrees of freedom. +- **d2**: `[in] double` denominator degrees of freedom. + +```c +double stdlib_base_dists_f_pdf( const double x, const double d1, const double d2 ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/f/pdf.h" +#include +#include +#include + +static double random_uniform( const double min, const double max ) { + double v = (double)rand() / ( (double)RAND_MAX + 1.0 ); + return min + ( v*(max-min) ); +} + +int main( void ) { + double x; + double d1; + double d2; + double y; + int32_t i; + + for ( i = 0; i < 10; i++ ) { + x = random_uniform( 0.0, 4.0 ); + d1 = random_uniform( 0.0, 10.0 ); + d2 = random_uniform( 0.0, 10.0 ); + y = stdlib_base_dists_f_pdf( x, d1, d2 ); + printf( "x: %lf, d1: %lf, d2: %lf, F(x;d1,d2): %lf\n", x, d1, d2, y ); + } +} +``` + +
+ + + +
+ + +