diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.js index eeec638b8b44..7cc3f5b12b94 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -34,24 +33,21 @@ var pdf = require( './../lib' ); bench( pkg, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var x; var y; var i; - len = 100; - x = new Float64Array( len ); - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( EPS, 2.0 ); - alpha[ i ] = uniform( EPS, 100.0 ); - beta[ i ] = uniform( EPS, 100.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 100.0, opts ); + beta = uniform( 100, EPS, 100.0, opts ); + x = uniform( 100, EPS, 2.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = pdf( x[ i % len ], alpha[ i % len ], beta[ i % len ] ); + y = pdf( x[ i % x.length ], alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -68,24 +64,23 @@ bench( pkg+':factory', function benchmark( b ) { var mypdf; var alpha; var beta; - var len; + var opts; var x; var y; var i; + opts = { + 'dtype': 'float64' + }; + x = uniform( 100, EPS, 2.0, opts ); + alpha = 100.56789; beta = 55.54321; mypdf = pdf.factory( alpha, beta ); - len = 100; - x = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( EPS, 2.0 ); - } - b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = mypdf( x[ i % len ] ); + y = mypdf( x[ i % x.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.native.js index e9ce92086cec..8f2c9254f745 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/benchmark/benchmark.native.js @@ -22,8 +22,7 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var uniform = require( '@stdlib/random/base/uniform' ); -var Float64Array = require( '@stdlib/array/float64' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var tryRequire = require( '@stdlib/utils/try-require' ); var EPS = require( '@stdlib/constants/float64/eps' ); @@ -43,24 +42,21 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var x; var y; var i; - len = 100; - x = new Float64Array( len ); - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - x[ i ] = uniform( EPS, 2.0 ); - alpha[ i ] = uniform( EPS, 100.0 ); - beta[ i ] = uniform( EPS, 100.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 100.0, opts ); + beta = uniform( 100, EPS, 100.0, opts ); + x = uniform( 100, EPS, 2.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = pdf( x[ i % len ], alpha[ i % len ], beta[ i % len ] ); + y = pdf( x[ i % x.length ], alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.factory.js index 00b593ad22f3..45c341a93198 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.factory.js @@ -56,23 +56,23 @@ tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', pdf = factory( 1.0, 1.0 ); y = pdf( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, 1.0 ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( 1.0, NaN ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, NaN ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, NaN ); y = pdf( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -83,16 +83,16 @@ tape( 'if provided a valid `alpha` and `beta`, the function returns a function w pdf = factory( 0.5, 1.0 ); y = pdf( NINF ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( -100.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( -0.5 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( 0.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -104,26 +104,26 @@ tape( 'if provided `beta <= 0`, the created function always returns `NaN`', func pdf = factory( 0.0, -1.0 ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( 0.0, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( PINF, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NINF, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NaN, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -135,26 +135,26 @@ tape( 'if provided `alpha <= 0`, the created function always returns `NaN`', fun pdf = factory( -1.0, 0.5 ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NINF, 1.0 ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NINF, PINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NINF, NINF ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); pdf = factory( NINF, NaN ); y = pdf( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.native.js index bdb326e31a9a..647d05eb86de 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.native.js @@ -55,11 +55,11 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { var y = pdf( NaN, 1.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -67,16 +67,16 @@ tape( 'if provided a nonpositive number for `x` and a valid `alpha` and `beta`, var y; y = pdf( NINF, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( -100.0, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( -0.5, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( 0.0, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -85,22 +85,22 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', opts, function tes var y; y = pdf( 2.0, -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -109,22 +109,22 @@ tape( 'if provided `beta <= 0`, the function returns `NaN`', opts, function test var y; y = pdf( 2.0, 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.pdf.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.pdf.js index a87881ec4d65..b3c5fc8e6d56 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.pdf.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/pdf/test/test.pdf.js @@ -46,11 +46,11 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var y = pdf( NaN, 1.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -58,16 +58,16 @@ tape( 'if provided a nonpositive number for `x` and a valid `alpha` and `beta`, var y; y = pdf( NINF, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( -100.0, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( -0.5, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); y = pdf( 0.0, 1.0, 1.0 ); - t.equal( y, 0.0, 'returns 0' ); + t.equal( y, 0.0, 'returns expected value' ); t.end(); }); @@ -76,22 +76,22 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', function test( t ) var y; y = pdf( 2.0, -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -100,22 +100,22 @@ tape( 'if provided `beta <= 0`, the function returns `NaN`', function test( t ) var y; y = pdf( 2.0, 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 0.0, 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = pdf( 2.0, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/benchmark/benchmark.js index 3f746d758b83..511a109442ff 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -34,24 +33,21 @@ var quantile = require( './../lib' ); bench( pkg, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var p; var y; var i; - len = 100; - p = new Float64Array( len ); - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - alpha[ i ] = uniform( EPS, 100.0 ); - beta[ i ] = uniform( EPS, 100.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 100.0, opts ); + beta = uniform( 100, EPS, 100.0, opts ); + p = uniform( 100, 0.0, 1.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = quantile( p[ i % len ], alpha[ i % len ], beta[ i % len ] ); + y = quantile( p[ i % p.length ], alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } @@ -68,23 +64,23 @@ bench( pkg+':factory', function benchmark( b ) { var myQuantile; var alpha; var beta; - var len; + var opts; var p; var y; var i; + opts = { + 'dtype': 'float64' + }; + p = uniform( 100, 0.0, 1.0, opts ); + alpha = 100.56789; beta = 55.54321; myQuantile = quantile.factory( alpha, beta ); - len = 100; - p = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - p[ i ] = uniform( 0.0, 1.0 ); - } b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = myQuantile( p[ i % len ] ); + y = myQuantile( p[ i % p.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.factory.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.factory.js index 03540f95ad4a..d9f7445ddb42 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.factory.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.factory.js @@ -56,23 +56,23 @@ tape( 'if provided `NaN` for any parameter, the created function returns `NaN`', quantile = factory( 1.0, 1.0 ); y = quantile( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, 1.0 ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( 1.0, NaN ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, NaN ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, NaN ); y = quantile( NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -83,10 +83,10 @@ tape( 'if provided a finite `alpha` and `beta`, the function returns a function quantile = factory( 1.0, 1.0 ); y = quantile( -0.1 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 1.1 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -98,26 +98,26 @@ tape( 'if provided a nonpositive `beta`, the created function always returns `Na quantile = factory( 0.0, -1.0 ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( 0.0, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( PINF, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NINF, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NaN, NINF ); y = quantile( 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -129,31 +129,31 @@ tape( 'if provided a nonpositive `alpha`, the created function always returns `N quantile = factory( 0.0, 0.5 ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( -1.0, 0.5 ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NINF, 1.0 ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NINF, PINF ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NINF, NINF ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); quantile = factory( NINF, NaN ); y = quantile( 0.5 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.quantile.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.quantile.js index fd8edb178ece..fb4a6ed130f0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.quantile.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/quantile/test/test.quantile.js @@ -46,19 +46,19 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var y = quantile( NaN, 0.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0, NaN, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.0, 1.0, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); tape( 'if provided a number outside `[0,1]` for `p` and a valid `alpha` and `beta`, the function returns `NaN`', function test( t ) { var y = quantile( 1.1, 1.0, 1.0 ); - t.equal( isnan( y ), true, 'returns true' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( -0.1, 1.0, 1.0 ); - t.equal( isnan( y ), true, 'returns true' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -66,25 +66,25 @@ tape( 'if provided a nonpositive `alpha`, the function returns `NaN`', function var y; y = quantile( 0.5, 0.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -93,25 +93,25 @@ tape( 'if provided a nonpositive `beta`, the function returns `NaN`', function t var y; y = quantile( 0.5, 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = quantile( 0.5, NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.js index a6624ac9d233..fe4ee710e405 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -34,21 +33,19 @@ var skewness = require( './../lib' ); bench( pkg, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var y; var i; - len = 100; - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - alpha[ i ] = uniform( EPS, 20.0 ); - beta[ i ] = uniform( 3.0 + EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 20.0, opts ); + beta = uniform( 100, 3.0 + EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = skewness( alpha[ i % len ], beta[ i % len ] ); + y = skewness( alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.native.js index b2065c8bb1aa..1531407cbbe0 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/benchmark/benchmark.native.js @@ -22,9 +22,8 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -43,21 +42,19 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var y; var i; - len = 100; - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - alpha[ i ] = uniform( EPS, 20.0 ); - beta[ i ] = uniform( 3.0 + EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 20.0, opts ); + beta = uniform( 100, 3.0 + EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = skewness( alpha[ i % len ], beta[ i % len ] ); + y = skewness( alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.js index f3aebdae6910..692d2a5af25d 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.js @@ -44,10 +44,10 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var v = skewness( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = skewness( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -56,19 +56,19 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', function test( t ) var y; y = skewness( -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -77,31 +77,31 @@ tape( 'if provided `beta <= 3`, the function returns `NaN`', function test( t ) var y; y = skewness( 2.0, 3.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.native.js index 223c16416882..ab018cb16074 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/skewness/test/test.native.js @@ -53,10 +53,10 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { var v = skewness( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = skewness( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -65,19 +65,19 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', opts, function tes var y; y = skewness( -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -86,31 +86,31 @@ tape( 'if provided `beta <= 3`, the function returns `NaN`', opts, function test var y; y = skewness( 2.0, 3.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = skewness( NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.js index a30b1763e22d..d5fc48f4eaf2 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -34,21 +33,19 @@ var stdev = require( './../lib' ); bench( pkg, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var y; var i; - len = 100; - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - alpha[ i ] = uniform( EPS, 20.0 ); - beta[ i ] = uniform( 2.0 + EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 20.0, opts ); + beta = uniform( 100, 2.0 + EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = stdev( alpha[ i % len ], beta[ i % len ] ); + y = stdev( alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.native.js index dbbccfe532fe..236b7bc1e782 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/benchmark/benchmark.native.js @@ -22,9 +22,8 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -43,21 +42,19 @@ var opts = { bench( pkg+'::native', opts, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var y; var i; - len = 100; - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - alpha[ i ] = uniform( EPS, 20.0 ); - beta[ i ] = uniform( 2.0 + EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 20.0, opts ); + beta = uniform( 100, 2.0 + EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = stdev( alpha[ i % len ], beta[ i % len ] ); + y = stdev( alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.js index 4e38651fe5a9..6335e374af8c 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.js @@ -44,10 +44,10 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var v = stdev( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = stdev( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -56,19 +56,19 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', function test( t ) var y; y = stdev( -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -77,28 +77,28 @@ tape( 'if provided `beta <= 2`, the function returns `NaN`', function test( t ) var y; y = stdev( 2.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 2.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.native.js index 8bdc5135b4ec..69c1a51222dc 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/stdev/test/test.native.js @@ -53,10 +53,10 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { var v = stdev( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = stdev( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -65,19 +65,19 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', opts, function tes var y; y = stdev( -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -86,28 +86,28 @@ tape( 'if provided `beta <= 2`, the function returns `NaN`', opts, function test var y; y = stdev( 2.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 2.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = stdev( NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/benchmark/benchmark.js index 50d9a7843e94..aec07ab4e002 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/benchmark/benchmark.js @@ -21,8 +21,7 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var Float64Array = require( '@stdlib/array/float64' ); -var uniform = require( '@stdlib/random/base/uniform' ); +var uniform = require( '@stdlib/random/array/uniform' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var EPS = require( '@stdlib/constants/float64/eps' ); var pkg = require( './../package.json' ).name; @@ -34,21 +33,19 @@ var variance = require( './../lib' ); bench( pkg, function benchmark( b ) { var alpha; var beta; - var len; + var opts; var y; var i; - len = 100; - alpha = new Float64Array( len ); - beta = new Float64Array( len ); - for ( i = 0; i < len; i++ ) { - alpha[ i ] = uniform( EPS, 20.0 ); - beta[ i ] = uniform( 2.0 + EPS, 20.0 ); - } + opts = { + 'dtype': 'float64' + }; + alpha = uniform( 100, EPS, 20.0, opts ); + beta = uniform( 100, 2.0 + EPS, 20.0, opts ); b.tic(); for ( i = 0; i < b.iterations; i++ ) { - y = variance( alpha[ i % len ], beta[ i % len ] ); + y = variance( alpha[ i % alpha.length ], beta[ i % beta.length ] ); if ( isnan( y ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.js index 478d49a7926e..cc1a0f3acf83 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.js @@ -44,10 +44,10 @@ tape( 'main export is a function', function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) { var v = variance( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = variance( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -56,19 +56,19 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', function test( t ) var y; y = variance( -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -77,28 +77,28 @@ tape( 'if provided `beta <= 2`, the function returns `NaN`', function test( t ) var y; y = variance( 2.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 2.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.native.js b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.native.js index 84c65d777d40..c6c1cd706361 100644 --- a/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.native.js +++ b/lib/node_modules/@stdlib/stats/base/dists/betaprime/variance/test/test.native.js @@ -53,10 +53,10 @@ tape( 'main export is a function', opts, function test( t ) { tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) { var v = variance( NaN, 0.5 ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); v = variance( 10.0, NaN ); - t.equal( isnan( v ), true, 'returns NaN' ); + t.equal( isnan( v ), true, 'returns expected value' ); t.end(); }); @@ -65,19 +65,19 @@ tape( 'if provided `alpha <= 0`, the function returns `NaN`', opts, function tes var y; y = variance( -1.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, PINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, NaN ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); }); @@ -86,28 +86,28 @@ tape( 'if provided `beta <= 2`, the function returns `NaN`', opts, function test var y; y = variance( 2.0, 2.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 2.0, 1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 2.0, 0.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 2.0, -1.0 ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( 1.0, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( PINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NINF, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); y = variance( NaN, NINF ); - t.equal( isnan( y ), true, 'returns NaN' ); + t.equal( isnan( y ), true, 'returns expected value' ); t.end(); });