Skip to content

Commit 2e59bca

Browse files
committed
chore: minor clean-up
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 2cd69fe commit 2e59bca

File tree

8 files changed

+40
-63
lines changed

8 files changed

+40
-63
lines changed

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ for ( i = 0; i < 10; i++ ) {
191191

192192
#### stdlib_base_dists_pareto_type1_logcdf( x, alpha, beta )
193193

194-
Returns the logcdf of a Pareto (Type I) distribution.
194+
Evaluates the natural logarithm of the cumulative distribution function (CDF) for a Pareto (Type I) distribution with parameters `alpha` (shape parameter) and `beta` (scale parameter).
195195

196196
```c
197197
double y = stdlib_base_dists_pareto_type1_logcdf( 2.0, 1.0, 1.0 );
@@ -200,43 +200,55 @@ double y = stdlib_base_dists_pareto_type1_logcdf( 2.0, 1.0, 1.0 );
200200

201201
The function accepts the following arguments:
202202

203-
- **x**: `[in] double` first shape parameter.
204-
- **alpha**: `[in] double` second shape parameter.
205-
- **beta**: `[in] double` third shape parameter.
203+
- **x**: `[in] double` input value.
204+
- **alpha**: `[in] double` shape parameter.
205+
- **beta**: `[in] double` scale parameter.
206206

207207
```c
208208
double stdlib_base_dists_pareto_type1_logcdf( const double x, const double alpha, const double beta );
209209
```
210210
211211
</section>
212+
212213
<!-- /.usage -->
214+
213215
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
216+
214217
<section class="notes">
218+
215219
</section>
220+
216221
<!-- /.notes -->
222+
217223
<!-- C API usage examples. -->
224+
218225
<section class="examples">
226+
219227
### Examples
228+
220229
```c
221230
#include "stdlib/stats/base/dists/pareto-type1/logcdf.h"
222231
#include <stdlib.h>
223232
#include <stdio.h>
233+
224234
static double random_uniform( const double min, const double max ) {
225235
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
226236
return min + ( v*(max-min) );
227237
}
238+
228239
int main( void ) {
229240
double alpha;
230241
double beta;
231242
double x;
232243
double y;
233244
int i;
245+
234246
for ( i = 0; i < 25; i++ ) {
235-
alpha = random_uniform( 0, 10 ) + 3.0;
236-
beta = random_uniform( 0, 10 );
237-
x = random_uniform( 0, 10 );
247+
x = random_uniform( 0.0, 8.0 );
248+
alpha = random_uniform( 0.0, 5.0 );
249+
beta = random_uniform( 0.0, 5.0 );
238250
y = stdlib_base_dists_pareto_type1_logcdf( x, alpha, beta );
239-
printf( "x: %lf, α: %lf, β: %lf, logcdf(X,α,β): %lf\n", x, alpha, beta, y );
251+
printf( "x: %lf, α: %lf, β: %lf, ln(F(x;α,β)): %lf\n", x, alpha, beta, y );
240252
}
241253
}
242254
```

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/benchmark/benchmark.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ bench( pkg, function benchmark( b ) {
4444
beta = new Float64Array( len );
4545
x = new Float64Array( len );
4646
for ( i = 0; i < len; i++ ) {
47-
alpha[ i ] = uniform( EPS, 100.0 );
48-
beta[ i ] = uniform( 3.0 + EPS, 100.0 );
49-
x[ i ] = uniform( EPS, 20.0 );
47+
x[ i ] = uniform( 0.0, 8.0 );
48+
alpha[ i ] = uniform( EPS, 10.0 );
49+
beta[ i ] = uniform( EPS, 10.0 );
5050
}
5151

5252
b.tic();

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/benchmark/benchmark.native.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench' );
2525
var Float64Array = require( '@stdlib/array/float64' );
2626
var tryRequire = require( '@stdlib/utils/try-require' );
27-
var randu = require( '@stdlib/random/base/randu' );
27+
var uniform = require( '@stdlib/random/base/uniform' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2929
var EPS = require( '@stdlib/constants/float64/eps' );
3030
var pkg = require( './../package.json' ).name;
@@ -53,9 +53,9 @@ bench( pkg, opts, function benchmark( b ) {
5353
beta = new Float64Array( len );
5454
x = new Float64Array( len );
5555
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = ( randu() * 1.0 );
57-
alpha[ i ] = ( randu() * 10.0 ) + 3.0 + EPS;
58-
beta[ i ] = ( randu() * 10.0 ) + EPS;
56+
x[ i ] = uniform( 0.0, 8.0 );
57+
alpha[ i ] = uniform( EPS, 10.0 );
58+
beta[ i ] = uniform( EPS, 10.0 );
5959
}
6060

6161
b.tic();

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/benchmark/c/benchmark.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ static double benchmark( void ) {
101101
int i;
102102

103103
for ( i = 0; i < 100; i++ ) {
104-
x[ i ] = random_uniform( 0.0, 1.0 );
105-
alpha[ i ] = random_uniform( 0.0, 10.0 ) + 3.0;
106-
beta[ i ] = random_uniform( 0.0, 10.0 ) + 3.0;
104+
x[ i ] = random_uniform( 0.0, 8.0 );
105+
alpha[ i ] = random_uniform( 0.1, 5.0 );
106+
beta[ i ] = random_uniform( 0.1, 5.0 );
107107
}
108108

109109
t = tic();

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/examples/c/example.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ int main( void ) {
3333
int i;
3434

3535
for ( i = 0; i < 25; i++ ) {
36-
x = random_uniform( 0, 1 );
37-
alpha = random_uniform( 0, 10 ) + 3.0;
38-
beta = random_uniform( 0, 10 );
36+
x = random_uniform( 0.0, 8.0 );
37+
alpha = random_uniform( 0.0, 5.0 );
38+
beta = random_uniform( 0.0, 5.0 );
3939
y = stdlib_base_dists_pareto_type1_logcdf( x, alpha, beta );
40-
printf( "x: %lf, α: %lf, β: %lf, logcdf(X;α,β): %lf\n", x, alpha, beta, y );
40+
printf( "x: %lf, α: %lf, β: %lf, ln(F(x;α,β)): %lf\n", x, alpha, beta, y );
4141
}
4242
}

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/include/stdlib/stats/base/dists/pareto-type1/logcdf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Returns the logcdf of a Pareto (Type I) distribution.
30+
* Evaluates the logcdf of a Pareto (Type I) distribution.
3131
*/
3232
double stdlib_base_dists_pareto_type1_logcdf( const double x, const double alpha, const double beta );
3333

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/lib/native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var addon = require( './../src/addon.node' );
2828
/**
2929
* Evaluates the cumulative distribution function (CDF) for a Pareto (Type I) distribution with shape parameter `alpha` and scale parameter `beta` at a value `x`.
3030
*
31+
* @private
3132
* @param {number} x - input value
3233
* @param {PositiveNumber} alpha - shape parameter
3334
* @param {PositiveNumber} beta - scale parameter

lib/node_modules/@stdlib/stats/base/dists/pareto-type1/logcdf/src/main.c

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,50 +28,14 @@
2828
/**
2929
* Evaluates the cumulative distribution function (CDF) for a Pareto (Type I) distribution with shape parameter `alpha` and scale parameter `beta` at a value `x`.
3030
*
31-
* @param {number} x - input value
32-
* @param {PositiveNumber} alpha - shape parameter
33-
* @param {PositiveNumber} beta - scale parameter
34-
* @returns {number} evaluated logCDF
31+
* @param x input value
32+
* @param alpha shape parameter
33+
* @param beta scale parameter
34+
* @return evaluated logCDF
3535
*
3636
* @example
3737
* double y = stdlib_base_dists_pareto_type1_logcdf( 2.0, 1.0, 1.0 );
3838
* // returns ~-0.693
39-
*
40-
* @example
41-
* double y = stdlib_base_dists_pareto_type1_logcdf( 5.0, 2.0, 4.0 );
42-
* // returns ~-1.022
43-
*
44-
* @example
45-
* double y = stdlib_base_dists_pareto_type1_logcdf( 4.0, 2.0, 2.0 );
46-
* // returns ~-0.288
47-
*
48-
* @example
49-
* double y = stdlib_base_dists_pareto_type1_logcdf( 1.9, 2.0, 2.0 );
50-
* // returns -Infinity
51-
*
52-
* @example
53-
* double y = stdlib_base_dists_pareto_type1_logcdf( +Infinity, 4.0, 2.0 );
54-
* // returns 0.0
55-
*
56-
* @example
57-
* double y = stdlib_base_dists_pareto_type1_logcdf( 2.0, -1.0, 0.5 );
58-
* // returns NaN
59-
*
60-
* @example
61-
* double y = stdlib_base_dists_pareto_type1_logcdf( 2.0, 0.5, -1.0 );
62-
* // returns NaN
63-
*
64-
* @example
65-
* double y = stdlib_base_dists_pareto_type1_logcdf( NaN, 1.0, 1.0 );
66-
* // returns NaN
67-
*
68-
* @example
69-
* double y = stdlib_base_dists_pareto_type1_logcdf( 0.0, NaN, 1.0 );
70-
* // returns NaN
71-
*
72-
* @example
73-
* double y = stdlib_base_dists_pareto_type1_logcdf( 0.0, 1.0, NaN );
74-
* // returns NaN
7539
*/
7640
double stdlib_base_dists_pareto_type1_logcdf( const double x, const double alpha, const double beta ) {
7741
if (

0 commit comments

Comments
 (0)