diff --git a/lib/node_modules/@stdlib/stats/base/dists/planck/mgf/README.md b/lib/node_modules/@stdlib/stats/base/dists/planck/mgf/README.md index c0230d074d18..995e6481c213 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/planck/mgf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/planck/mgf/README.md @@ -138,6 +138,102 @@ for ( i = 0; i < lambda.length; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/planck/mgf.h" +``` + +#### stdlib_base_dists_planck_mgf( t, lambda ) + +Evaluates the moment-generating function (MGF) for a Planck distribution with shape parameter `lambda` at a value `t`. + +```c +double out = stdlib_base_dists_planck_mgf( 0.2, 0.5 ); +// returns ~1.5181 +``` + +The function accepts the following arguments: + +- **t**: `[in] double` input value. +- **lambda**: `[in] double` shape parameter. + +```c +double stdlib_base_dists_planck_mgf( const double t, const double lambda ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/planck/mgf.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 t; + double lambda; + double y; + int i; + + for ( i = 0; i < 10; i++ ) { + t = random_uniform( 0.0, 10.0 ); + lambda = random_uniform( 0.1, 5.0 ); + y = stdlib_base_dists_planck_mgf( t, lambda ); + printf( "t: %lf, lambda: %lf, M_X(t; lambda): %lf\n", t, lambda, y ); + } + return 0; +} +``` + +
+ + + +
+ + +