diff --git a/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md index daf186718eb5..8acf0e4021d8 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/f/cdf/README.md @@ -150,6 +150,105 @@ logEachMap( 'x: %0.4f, d1: %0.4f, d2: %0.4f, F(x;d1,d2): %0.4f', x, d1, d2, cdf + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/f/cdf.h" +``` + +#### stdlib_base_dists_f_cdf( x, d1, d2 ) + +Evaluates the [cumulative distribution function][cdf] (CDF) for an [F][f-distribution] distribution with numerator degrees of freedom `d1` and denominator degrees of freedom `d2` at a value `x`. + +```c +double y = stdlib_base_dists_f_cdf( 2.0, 1.0, 1.0 ); +// returns ~0.608 +``` + +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_cdf( const double x, const double d1, const double d2 ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/f/cdf.h" +#include "stdlib/constants/float64/eps.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( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 ); + d2 = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 ); + y = stdlib_base_dists_f_cdf( x, d1, d2 ); + printf( "x: %lf, d1: %lf, d2: %lf, F(x;d1,d2): %lf\n", x, d1, d2, y ); + } +} +``` + +
+ + + +
+ + +