diff --git a/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md index 24113674ccb9..784bf499537f 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/lognormal/logcdf/README.md @@ -124,6 +124,105 @@ logEachMap( 'x: %0.4f, µ: %0.4f, σ: %0.4f, ln(F(x;µ,σ)): %0.4f', x, mu, sigm + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/lognormal/logcdf.h" +``` + +#### stdlib_base_dists_lognormal_logcdf( x, mu, sigma ) + +Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [lognormal][lognormal-distribution] distribution with mean `mu` and standard deviation `sigma` at a value `x`. + +```c +double y = stdlib_base_dists_lognormal_logcdf( 2.0, 0.0, 1.0 ); +// returns ~-0.2799 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **mu**: `[in] double` mean. +- **sigma**: `[in] double` standard deviation. + +```c +double stdlib_base_dists_lognormal_logcdf( const double x, const double mu, const double sigma ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/lognormal/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) ); +} + +int main( void ) { + double x; + double mu; + double sigma; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.0, 100.0 ); + mu = random_uniform( -10.0, 10.0 ); + sigma = random_uniform( 0.1, 10.0 ); + y = stdlib_base_dists_lognormal_logcdf( x, mu, sigma ); + printf( "x: %lf, mu: %lf, sigma: %lf, ln(f(x;mu,sigma)): %lf\n", x, mu, sigma, y ); + } +} +``` + +
+ + + +
+ + + +