diff --git a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md index b2be828ad786..7728ac2d3bd5 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logpdf/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2024 The Stdlib Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -166,6 +166,98 @@ for ( i = 0; i < 10; i++ ) { + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/pareto-type1/logpdf.h" +``` + +#### stdlib_base_dists_pareto_type1_logpdf( x, alpha, beta ) + +Evaluates the natural logarithm of the probability density function (PDF) for a Pareto (Type I) distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter). + +```c +double y = stdlib_base_dists_pareto_type1_logpdf( 4.0, 1.0, 1.0 ); +// returns ~-2.773 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **alpha**: `[in] double` shape parameter. +- **beta**: `[in] double` scale parameter. + +```c +double stdlib_base_dists_pareto_type1_logpdf( const double x, const double alpha, const double beta ); +``` + +
+ + +
+
+ + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/pareto-type1/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 beta; + double x; + double y; + int i; + + for ( i = 0; i < 25; i++ ) { + alpha = random_uniform( 0.1, 5.0 ); + beta = random_uniform( alpha, alpha + 5.0 ); + x = random_uniform( beta, beta + 10.0 ); + y = stdlib_base_dists_pareto_type1_logpdf( x, alpha, beta ); + printf( "x: %lf, α: %lf, β: %lf, ln(f(x;α,β)): %lf\n", x, alpha, beta, y ); + } +} +``` + +
+ + + +
+ + + +