diff --git a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md index 3f9f131d2406..f5fff13b22b7 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/cauchy/logcdf/README.md @@ -149,6 +149,104 @@ for ( i = 0; i < 10; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/cauchy/logcdf.h" +``` + +#### stdlib_base_dists_cauchy_logcdf( x, x0, gamma ) + +Evaluates the natural logarithm of the [cumulative distribution function][cdf] for a [Cauchy][cauchy-distribution] distribution with location parameter `x0` and scale parameter `gamma` at a value `x`. + +```c +double out = stdlib_base_dists_cauchy_logcdf( 4.0, 0.0, 2.0 ); +// returns ~-0.16 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **x0**: `[in] double` location parameter. +- **gamma**: `[in] double` scale parameter. + +```c +double stdlib_base_dists_cauchy_logcdf( const double x, const double x0, const double gamma ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/cauchy/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 x0; + double gamma; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( -10.0, 10.0 ); + x0 = random_uniform( -10.0, 10.0 ); + gamma = random_uniform( 0, 10.0 ); + y = stdlib_base_dists_cauchy_logcdf( x, x0, gamma ); + printf( "x: %lf, a: %lf, b: %lf, F(x;a,b): %lf\n", x, x0, gamma, y ); + } +} +``` + +
+ + + +
+ + +