diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md index f00b69fe23d3..982acffb5e2c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/entropy/README.md @@ -120,6 +120,98 @@ for ( i = 0; i < lambda.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/planck/entropy.h" +``` + +#### stdlib_base_dists_planck_entropy( lambda ) + +Returns the [differential entropy][entropy] of a Planck distribution with shape parameter `lambda` (in [nats][nats]). + +```c +double out = stdlib_base_dists_planck_entropy( 1.5 ); +// returns ~0.6833 +``` + +The function accepts the following arguments: + +- **lambda**: `[in] double` shape parameter. + +```c +double stdlib_base_dists_planck_entropy( const double lambda ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/planck/entropy.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 lambda; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + lambda = random_uniform( 0.1, 5.0 ); + y = stdlib_base_dists_planck_entropy( lambda ); + printf( "λ: %lf, H(X;λ): %lf\n", lambda, y ); + } +} +``` + +
+ + + +
+ + +