diff --git a/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md index 3788a5468ea9..475e4ce83c76 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/degenerate/pdf/README.md @@ -127,6 +127,102 @@ for ( i = 0; i < 100; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/degenerate/pdf.h" +``` + +#### stdlib_base_dists_degenerate_pdf( x, mu ) + +Evaluates the [PDF][pdf] of a [degenerate distribution][degenerate-distribution] centered at `mu`. + +```c +double out = stdlib_base_dists_degenerate_pdf( 2.0, 3.0 ); +// returns 0.0 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **mu**: `[in] double` constant value of the distribution. + +```c +double stdlib_base_dists_degenerate_pdf( const double x, const double mu ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/degenerate/pdf.h" +#include "stdlib/math/base/special/round.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 result; + double mu; + double x; + int i; + + for ( i = 0; i < 10; i++ ) { + x = stdlib_base_round( random_uniform( 0.0, 5.0 ) ); + mu = stdlib_base_round( random_uniform( 0.0, 5.0 ) ); + result = stdlib_base_dists_degenerate_pdf( x, mu ); + printf( "x: %lf, µ: %lf, f(x;µ): %lf \n", x, mu, result ); + } +} +``` + +
+ + + +
+ + +