Skip to content

Commit b8f93ba

Browse files
committed
refactor: update benchmarks to use array/uniform and fix documentation
1 parent c1dff28 commit b8f93ba

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ double out = stdlib_base_dists_pareto_type1_cdf( 2.0, 1.0, 1.0 );
191191
The function accepts the following arguments:
192192

193193
- **x**: `[in] double` input value.
194-
- **alpha**: `[in] double` first shape parameter.
195-
- **beta**: `[in] double` second shape parameter.
194+
- **alpha**: `[in] double` shape parameter.
195+
- **beta**: `[in] double` scale parameter.
196196

197197
```c
198198
double stdlib_base_dists_pareto_type1_cdf( const double x, const double alpha, const double beta );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ bench( pkg+':factory', function benchmark( b ) {
8585
len = 100;
8686
x = new Float64Array( len );
8787
for ( i = 0; i < len; i++ ) {
88-
x[ i ] = ( randu() * 50.0 ) + EPS;
88+
x[ i ] = uniform( EPS, 50.0 + EPS );
8989
}
9090

9191
b.tic();

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var resolve = require( 'path' ).resolve;
2424
var tryRequire = require( '@stdlib/utils/try-require' );
2525
var bench = require( '@stdlib/bench' );
2626
var Float64Array = require( '@stdlib/array/float64' );
27-
var randu = require( '@stdlib/random/base/randu' );
27+
var uniform = require( '@stdlib/random/array/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;
@@ -49,14 +49,9 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4949
var i;
5050

5151
len = 100;
52-
x = new Float64Array( len );
53-
alpha = new Float64Array( len );
54-
beta = new Float64Array( len );
55-
for ( i = 0; i < len; i++ ) {
56-
x[ i ] = ( randu() * 20.0 ) + EPS;
57-
alpha[ i ] = ( randu() * 100.0 ) + EPS;
58-
beta[ i ] = ( randu() * 100.0 ) + EPS;
59-
}
52+
x = uniform( len, EPS, 20.0 + EPS );
53+
alpha = uniform( len, EPS, 100.0 + EPS );
54+
beta = uniform( len, EPS, 100.0 + EPS );
6055

6156
b.tic();
6257
for ( i = 0; i < b.iterations; i++ ) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
* Evaluates the cumulative distribution function (CDF) for a Pareto (Type I) distribution with shape parameter `alpha` and scale parameter `beta` at a value `x`.
2525
*
2626
* @param x input value
27-
* @param alpha first shape parameter
28-
* @param beta second shape paramter
29-
* @return stdandard deviation
27+
* @param alpha shape parameter
28+
* @param beta scale parameter
29+
* @return evaluated CDF
3030
*
3131
* @example
3232
* double y = stdlib_base_dists_pareto_type1_cdf( 2.0, 1.0, 1.0 );

0 commit comments

Comments
 (0)