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..4ffb7a243ecc 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,104 @@ 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] (PDF) for an [F][f-distribution] distribution with numerator degrees of freedom `d1` and denominator degrees of freedom `d2`. + +```c +double out = stdlib_base_dists_f_pdf( 2.0, 1.0, 1.0 ); +// returns ~0.127 +``` + +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 + +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 d1; + double d2; + double x; + double y; + int i; + + for ( i = 0; i < 10; i++ ) { + x = random_uniform( 0.0, 10.0 ); + d1 = random_uniform( 1.0, 10.0 ); + d2 = random_uniform( 1.0, 10.0 ); + y = stdlib_base_dists_f_pdf( x, d1, d2 ); + printf( "x: %.4f, d1: %.4f, d2: %.4f, f(x;d1,d2): %.4f\n", x, d1, d2, y ); + } +} +``` + +
+ + + +
+ + +