Skip to content

Commit 36fc065

Browse files
fix: lint errors
1 parent 923e931 commit 36fc065

File tree

4 files changed

+127
-12
lines changed

4 files changed

+127
-12
lines changed

lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var y = cdf( 1.0, 0.5 );
6262
// returns 1.0
6363

6464
y = cdf( 0.5, 0.5 );
65-
// returns 0.5
65+
// returns 1.0
6666
```
6767

6868
If provided `NaN` as any argument, the function returns `NaN`.
@@ -188,7 +188,9 @@ The function accepts the following arguments:
188188
```c
189189
double stdlib_base_dists_bernoulli_cdf( const double x, const double p );
190190
```
191+
191192
</section>
193+
192194
<!-- /.usage -->
193195
194196
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
@@ -204,23 +206,24 @@ double stdlib_base_dists_bernoulli_cdf( const double x, const double p );
204206
<section class="examples">
205207
206208
### Examples
209+
207210
```c
208211
#include "stdlib/stats/base/dists/bernoulli/cdf.h"
209212
#include <stdlib.h>
210213
#include <stdio.h>
211214
212215
int main( void ) {
213-
double p;
216+
double p;
214217
double x;
215-
double y;
216-
int i;
217-
218+
double y;
219+
int i;
220+
218221
for ( i = 0; i < 25; i++ ) {
219222
x = ( (double)rand() / (double)RAND_MAX ) * 5.0;
220-
p = ( (double)rand() / (double)RAND_MAX ) ;
221-
y = stdlib_base_dists_bernoulli_cdf( x, p );
222-
printf( "x: %lf , p: %1f, F(X;p): %lf\n", x, p , y );
223-
}
223+
p = ( (double)rand() / (double)RAND_MAX ) ;
224+
y = stdlib_base_dists_bernoulli_cdf( x, p );
225+
printf( "x: %lf , p: %1f, F(X;p): %lf\n", x, p , y );
226+
}
224227
}
225228
```
226229

lib/node_modules/@stdlib/stats/base/dists/bernoulli/cdf/lib/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ var addon = require( './../src/addon.node' );
3434
*
3535
* @example
3636
* var y = cdf( 0.5, 0.5 );
37-
* // returns 0.5
37+
* // returns 1.0
3838
*
3939
* @example
4040
* var y = cdf( 2.0, 0.1 );

lib/node_modules/@stdlib/stats/base/dists/bernoulli/quantile/README.md

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2018 The Stdlib Authors.
5+
Copyright (c) 2024 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -145,6 +145,115 @@ for ( i = 0; i < 10; i++ ) {
145145

146146
<!-- /.examples -->
147147

148+
<!-- C interface documentation. -->
149+
150+
* * *
151+
152+
<section class="c">
153+
154+
## C APIs
155+
156+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
157+
158+
<section class="intro">
159+
160+
</section>
161+
162+
<!-- /.intro -->
163+
164+
<!-- C usage documentation. -->
165+
166+
<section class="usage">
167+
168+
### Usage
169+
170+
```c
171+
#include "stdlib/stats/base/dists/bernoulli/quantile.h"
172+
```
173+
174+
#### stdlib_base_dists_bernoulli_quantile( r , p )
175+
176+
Evaluates the quantile function for a Bernoulli distribution with success probability `p` at a probability `r`.
177+
178+
```c
179+
double y = stdlib_base_dists_bernoulli_quantile( 0.8, 0.4 );
180+
// returns ~1.0
181+
182+
y = stdlib_base_dists_bernoulli_quantile( 0.5, 0.4 );
183+
// returns ~0.0
184+
185+
y = stdlib_base_dists_bernoulli_quantile( 0.8, 0.1 );
186+
// returns ~0.0
187+
188+
y = stdlib_base_dists_bernoulli_quantile( -0.2, 0.1 );
189+
// returns ~NaN
190+
191+
y = stdlib_base_dists_bernoulli_quantile( NaN, 0.8 );
192+
// returns ~NaN
193+
194+
y = stdlib_base_dists_bernoulli_quantile( 0.4, NaN );
195+
// returns ~NaN
196+
197+
y = stdlib_base_dists_bernoulli_quantile( 0.5, -1.0 );
198+
// returns ~NaN
199+
200+
y = stdlib_base_dists_bernoulli_quantile( 0.5, 1.5 );
201+
// returns ~NaN
202+
```
203+
204+
The function accepts the following arguments:
205+
206+
- **r**: `[in] double` probability.
207+
- **p**: `[in] double` success probability.
208+
209+
```c
210+
double stdlib_base_dists_bernoulli_quantile( const double r, const double p );
211+
```
212+
213+
</section>
214+
215+
<!-- /.usage -->
216+
217+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
218+
219+
<section class="notes">
220+
221+
</section>
222+
223+
<!-- /.notes -->
224+
225+
<!-- C API usage examples. -->
226+
227+
<section class="examples">
228+
229+
### Examples
230+
231+
```c
232+
#include "stdlib/stats/base/dists/bernoulli/quantile.h"
233+
#include <stdlib.h>
234+
#include <stdio.h>
235+
236+
int main( void ) {
237+
double p;
238+
double r;
239+
double y;
240+
int i;
241+
242+
for ( i = 0; i < 25; i++ ) {
243+
r = ( (double)rand() / (double)RAND_MAX );
244+
p = ( (double)rand() / (double)RAND_MAX );
245+
y = stdlib_base_dists_bernoulli_quantile( r, p );
246+
printf( "r: %lf , p: %lf , Q(r;p): %lf\n", r , p , y );
247+
}
248+
}
249+
```
250+
251+
</section>
252+
253+
<!-- /.examples -->
254+
255+
</section>
256+
148257
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
149258

150259
<section class="related">

lib/node_modules/@stdlib/stats/base/dists/bernoulli/quantile/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
}
1515
],
1616
"main": "./lib",
17+
"gypfile": true,
1718
"directories": {
1819
"benchmark": "./benchmark",
1920
"doc": "./docs",
2021
"example": "./examples",
22+
"include": "./include",
2123
"lib": "./lib",
24+
"src": "./src",
2225
"test": "./test"
2326
},
2427
"types": "./docs/types",
@@ -56,7 +59,7 @@
5659
"distribution",
5760
"dist",
5861
"probability",
59-
"cdf",
62+
"quantile",
6063
"inverse",
6164
"discrete",
6265
"success probability",

0 commit comments

Comments
 (0)