diff --git a/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md index 52d505ed7363..ababb6568ca9 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/normal/logcdf/README.md @@ -128,6 +128,106 @@ for ( i = 0; i < 10; i++ ) { + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/normal/logcdf.h" +``` + +#### stdlib_base_dists_normal_logcdf( x, mu, sigma ) + +Evaluates the logarithm of the cumulative distribution function (logCDF) for a normal distribution. + +```c +double out = stdlib_base_dists_normal_cdf( 2.0, 0.0, 1.0 ); +// returns ~-0.023 +``` + +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_normal_logcdf( cconst double x, const double mu, const double sigma ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/normal/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 < 10; i++ ) { + x = random_uniform( 0.0, 10.0 ); + mu = random_uniform( -5.0, 5.0 ); + sigma = random_uniform( 0.1, 20.0 ); + y = stdlib_base_dists_normal_logcdf( x, mu, sigma ); + printf( "x: %lf, µ: %lf, σ: %lf, ln(F(x;µ,σ)): %lf\n", x, mu, sigma, y ); + } +} +``` + +
+ + + +
+ + +