diff --git a/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md index 30849581d276..2ddf3b182335 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/exponential/logcdf/README.md @@ -140,6 +140,102 @@ for ( i = 0; i < 10; i++ ) { + + +
+ + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/exponential/cdf.h" +``` + +#### stdlib_base_dists_exponential_cdf( x, lambda ) + +Evaluates the natural logarithm of the [cumulative distribution function (CDF)][cdf] for an exponential distribution with rate parameter `lambda`. + +```c +double out = stdlib_base_dists_exponential_logcdf( 2.0, 0.1 ); +// returns ~-1.708 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **lambda**: `[in] double` rate parameter. + +```c +double stdlib_base_dists_exponential_logcdf( const double x, const double lambda ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/exponential/logcdf.h" +#include "stdlib/constants/float64/eps.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 x; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.0, 100.0 ); + lambda = random_uniform( 0.0, 100.0 ) + STDLIB_CONSTANT_FLOAT64_EPS; + y = stdlib_base_dists_exponential_logcdf( x, lambda ); + printf( "x: %lf, λ: %lf, ln(F(x;λ)): %lf\n", x, lambda, y ); + } +} +``` + +
+ + +