diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md index 99cc5d125829..8b4aa1084069 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/quantile/README.md @@ -55,7 +55,7 @@ var quantile = require( '@stdlib/stats/base/dists/pareto-type1/quantile' ); #### quantile( p, alpha, beta ) -Evaluates the [quantile function][quantile-function] for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` ( scale parameter). +Evaluates the [quantile function][quantile-function] for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript var y = quantile( 0.8, 2.0, 1.0 ); @@ -113,7 +113,7 @@ y = quantile( 0.4, 1.0, 0.0 ); #### quantile.factory( alpha, beta ) -Returns a function for evaluating the [quantile function][quantile-function] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` ( scale parameter). +Returns a function for evaluating the [quantile function][quantile-function] of a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). ```javascript var myquantile = quantile.factory( 2.5, 0.5 ); @@ -157,6 +157,104 @@ for ( i = 0; i < 10; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/pareto-type1/quantile.h" +``` + +#### stdlib_base_dists_pareto_type1_quantile( p, alpha, beta ) + +Evaluates the [quantile function][quantile-function] for a [Pareto (Type I)][pareto-distribution] distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). + +```c +double y = stdlib_base_dists_pareto_type1_quantile( 0.8, 2.0, 1.0 ); +// returns ~2.236 +``` + +The function accepts the following arguments: + +- **p**: `[in] double` input probability. +- **alpha**: `[in] double` shape parameter. +- **beta**: `[in] double` scale parameter. + +```c +double stdlib_base_dists_pareto_type1_quantile( const double p, const double alpha, const double beta ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/pareto-type1/quantile.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 p; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + p = random_uniform( 0.0, 1.0 ); + alpha = random_uniform( 1.0, 10.0 ); + beta = random_uniform( 1.0, 10.0 ); + y = stdlib_base_dists_pareto_type1_quantile( p, alpha, beta ); + printf( "p: %lf, α: %lf, β: %lf, Q(p;α,β): %lf\n", p, alpha, beta, y ); + } +} +``` + +
+ + + +
+ + +