diff --git a/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md b/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md index 22862e4fb83d..cc9fb043bbb3 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md +++ b/lib/node_modules/@stdlib/stats/base/dists/beta/cdf/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2018 The Stdlib Authors. +Copyright (c) 2026 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. @@ -160,6 +160,113 @@ logEachMap( 'x: %0.4f, α: %0.4f, β: %0.4f, F(x;α,β): %0.4f', x, alpha, beta, + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +#include "stdlib/stats/base/dists/beta/cdf.h" +``` + +#### stdlib_base_dists_beta_cdf( x, alpha, beta ) + +Returns the [differential cdf][cdf] of a [beta][beta-distribution] distribution with parameters `alpha` (first shape parameter) and `beta` (second shape parameter). + +```c +double y = stdlib_base_dists_beta_cdf( 0.5, 1.0, 1.0 ); +// returns 0.5 +``` + +The function accepts the following arguments: + +- **x**: `[in] double` input value. +- **alpha**: `[in] double` first shape parameter. +- **beta**: `[in] double` second shape parameter. + +```c +double stdlib_base_dists_beta_cdf( const double x, const double alpha, const double beta ); +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +#include "stdlib/stats/base/dists/beta/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 alpha; + double beta; + double x; + double y; + int i; + + for ( i = 0; i < 10; i++ ) { + alpha = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 ); + beta = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 ); + x = random_uniform( 0.0, 1.0 ); + y = stdlib_base_dists_beta_cdf( x, alpha, beta ); + printf( "x: %lf, α: %lf, β: %lf, F(x;α,β): %lf\n", x, alpha, beta, y ); + } +} +``` + +
+ + + +
+ + + + + +
+ +
+ + +