diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md index d14304e5e82c..e4c7fda69a18 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md @@ -130,6 +130,105 @@ for ( i = 0; i < lambda.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/planck/logcdf.h" +``` + +#### stdlib_base_dists_planck_logcdf( x, lambda ) + +Evaluates the logarithm of cumulative distribution function (logcdf) for an planck distribution with shape parameter `lambda`. + +```c +double out = stdlib_base_dists_planck_logcdf( 2, 0.5,); +// returns ~-0.2525 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **lambda**: `[in] double` shape parameter. + +```c +double stdlib_base_dists_planck_logcdf +( const double x, const double lambda ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/planck/logcdf.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) ); +} +static int discrete_uniform( const int min, const int max ) { + return min + (rand() % (max - min + 1)); +} + +int main( void ) { + double x; + double lambda; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = discrete_uniform( 0, 40.0 ); + lambda = random_uniform( 0.1, 5.0 ); + y = stdlib_base_dists_planck_logcdf( x, lambda ); + printf( "x: %lf, λ: %lf, ln(F(x;λ)): %lf\n", x, lambda, y ); + } +} +``` + +
+ + + +
+ + + +