diff --git a/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md index f4fb722dc739..49f7d46e4d4c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/t/logcdf/README.md @@ -124,13 +124,14 @@ y = mylogcdf( 1.0 ); ```javascript var uniform = require( '@stdlib/random/array/uniform' ); var logEachMap = require( '@stdlib/console/log-each-map' ); +var EPS = require( '@stdlib/constants/float64/eps' ); var logcdf = require( '@stdlib/stats/base/dists/t/logcdf' ); var opts = { 'dtype': 'float64' }; var x = uniform( 10, -3.0, 3.0, opts ); -var v = uniform( 10, 0.0, 10.0, opts ); +var v = uniform( 10, EPS, 10.0, opts ); logEachMap( 'x: %0.4f, v: %0.4f, ln(F(x;v)): %0.4f', x, v, logcdf ); ``` @@ -139,6 +140,102 @@ logEachMap( 'x: %0.4f, v: %0.4f, ln(F(x;v)): %0.4f', x, v, logcdf ); + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/t/logcdf.h" +``` + +#### stdlib_base_dists_t_logcdf( x, v ) + +Evaluates the natural logarithm of the [cumulative distribution function][cdf] (CDF) for a [Student's t][t-distribution] distribution with degrees of freedom `v`. + +```c +double out = stdlib_base_dists_t_logcdf( 2.0, 0.1 ); +// returns ~-0.493 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **v**: `[in] double` degrees of freedom. + +```c +double stdlib_base_dists_t_logcdf( const double x, const double v ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/t/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 x; + double v; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( -3.0, 3.0 ); + v = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 10.0 ); + y = stdlib_base_dists_t_logcdf( x, v ); + printf( "x: %lf, v: %lf, ln(F(x;v)): %lf\n", x, v, y ); + } +} +``` + +
+ + + +
+ + +