diff --git a/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md index dd3dacc37727..7e57af5aecb3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/frechet/logpdf/README.md @@ -71,7 +71,7 @@ y = logpdf( 0.0, 2.0, 1.0, -1.0 ); If provided `x <= m`, the function returns `-Infinity`. ```javascript -y = logpdf( -2.0, 2.0, 1.0, -1.0 ); +var y = logpdf( -2.0, 2.0, 1.0, -1.0 ); // returns -Infinity ``` @@ -170,6 +170,109 @@ for ( i = 0; i < 100; i++ ) { + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/frechet/logpdf.h" +``` + +#### stdlib_base_dists_frechet_logpdf( x, alpha, s, m ) + +Evaluates the logarithm of the [probability density function][pdf] (PDF) for a [Fréchet][frechet-distribution] distribution with shape `alpha`, scale `s`, and location `m` at a value `x`. + +```c +double y = stdlib_base_dists_frechet_logpdf( 10.0, 2.0, 3.0, 2.0 ); +// returns ~-3.489 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **alpha**: `[in] double` shape parameter. +- **s**: `[in] double` scale parameter. +- **m**: `[in] double` location parameter. + +```c +double stdlib_base_dists_frechet_logpdf( const double x, const double alpha, const double s, const double m ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/frechet/logpdf.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 x; + double s; + double m; + double y; + int i; + + for ( i = 0; i < 10; i++ ) { + alpha = random_uniform( 0.0, 10.0 ); + x = random_uniform( 0.0, 10.0 ); + s = random_uniform( 0.0, 10.0 ); + m = random_uniform( 0.0, 10.0 ); + y = stdlib_base_dists_frechet_logpdf( x, alpha, s, m ); + printf( "x: %lf, α: %lf, s: %lf, m: %lf, ln(f(x;α,s,m)): %lf\n", x, alpha, s, m, y ); + } +} + +``` + +
+ + + +
+ + +