diff --git a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md index 3f7be04815db..37f400315684 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/cdf/README.md @@ -141,7 +141,7 @@ y = mycdf( 0.3 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/array/uniform' ); var EPS = require( '@stdlib/constants/float64/eps' ); var cdf = require( '@stdlib/stats/base/dists/kumaraswamy/cdf' ); @@ -151,12 +151,108 @@ var x; var y; var i; -for ( i = 0; i < 10; i++ ) { - x = randu(); - a = ( randu()*5.0 ) + EPS; - b = ( randu()*5.0 ) + EPS; - y = cdf( x, a, b ); - console.log( 'x: %d, a: %d, b: %d, F(x;a,b): %d', x.toFixed( 4 ), a.toFixed( 4 ), b.toFixed( 4 ), y.toFixed( 4 ) ); +x = uniform( 10, 0.0, 1.0 ); +a = uniform( 10, EPS, 5.0 ); +b = uniform( 10, EPS, 5.0 ); + +for ( i = 0; i < x.length; i++ ) { + y = cdf( x[ i ], a[ i ], b[ i ] ); + console.log( 'x: %d, a: %d, b: %d, F(x;a,b): %d', x[ i ].toFixed( 4 ), a[ i ].toFixed( 4 ), b[ i ].toFixed( 4 ), y.toFixed( 4 ) ); +} +``` + + + + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/kumaraswamy/cdf.h" +``` + +#### stdlib_base_dists_kumaraswamy_cdf( x, a, b ) + +Evaluates the [cumulative distribution function][cdf] (CDF) for a [Kumaraswamy's double bounded][kumaraswamy-distribution] distribution with parameters `a` (first shape parameter) and `b` (second shape parameter). + +```c +double out = stdlib_base_dists_kumaraswamy_cdf( 0.5, 1.0, 1.0 ); +// returns 0.5 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **a**: `[in] double` first shape parameter. +- **b**: `[in] double` second shape parameter. + +```c +double stdlib_base_dists_kumaraswamy_cdf( const double x, const double a, const double b ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/kumaraswamy/cdf.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 a; + double b; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + x = random_uniform( 0.0, 1.0 ); + a = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 ); + b = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 ); + y = stdlib_base_dists_kumaraswamy_cdf( x, a, b ); + printf( "x: %lf, a: %lf, b: %lf, F(x;a,b): %lf\n", x, a, b, y ); + } } ``` @@ -164,6 +260,10 @@ for ( i = 0; i < 10; i++ ) { +
+ + +