diff --git a/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md index 759a4183bb9b..b2c58a2e1b24 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/chi/logpdf/README.md @@ -137,6 +137,101 @@ logEachMap( 'x: %0.4f, k: %0.4f, ln(f(x;k)): %0.4f', x, k, logpdf ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/chi/logpdf.h" +``` + +#### stdlib_base_dists_chi_logpdf( x, k ) + +Evaluates the natural logarithm of the [probability density function][pdf] (PDF) for a [chi][chi-distribution] distribution with degrees of freedom `k`. + +```c +double out = stdlib_base_dists_chi_logpdf( 2.0, 2.0 ); +// returns ~-1.309 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **k**: `[in] double` degrees of freedom. + +```c +double stdlib_base_dists_chi_logpdf( const double x, const double k ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/chi/logpdf.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 x; + double k; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.0, 10.0 ); + k = random_uniform( 0.1, 10.0 ); + y = stdlib_base_dists_chi_logpdf( x, k ); + printf( "x: %lf, k: %lf, ln(f(x;k)): %lf\n", x, k, y ); + } +} +``` + +
+ + + +
+ + +