diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md index 0692790595d8..63e2795e4811 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/logcdf/README.md @@ -170,6 +170,100 @@ logEachMap( 'x: %0.4f, α: %0.4f, β: %0.4f, ln(F(x;α,β)): %0.4f', x, alpha, b +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/beta/logcdf.h" +``` + +#### stdlib_base_dists_beta_logcdf( x, alpha, beta ) + +Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). + +```c +double y = stdlib_base_dists_beta_logcdf( 0.5, 1.0, 1.0 ); +// returns ~-0.693 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **alpha**: `[in] double` first shape parameter. +- **beta**: `[in] double` second shape parameter. + +```c +double stdlib_base_dists_beta_logcdf( const double x, const double alpha, const double beta ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/beta/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 alpha; + double beta; + double x; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.0, 1.0 ); + alpha = random_uniform( 1.0, 10.0 ); + beta = random_uniform( 1.0, 10.0 ); + y = stdlib_base_dists_beta_logcdf( x, alpha, beta ); + printf( "x: %lf, α: %lf, β: %lf, ln(F(x;α,β)): %lf\n", x, alpha, beta, y ); + } +} +``` + +
+ + + +
+ + +