Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions lib/node_modules/@stdlib/stats/base/dists/f/variance/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
// MODULES //

var tape = require( 'tape' );
var abs = require( '@stdlib/math/base/special/abs' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
var variance = require( './../lib' );


Expand Down Expand Up @@ -108,8 +107,6 @@ tape( 'if provided `d2 <= 4`, the function returns `NaN`', function test( t ) {

tape( 'the function returns the variance of an F distribution', function test( t ) {
var expected;
var delta;
var tol;
var d1;
var d2;
var i;
Expand All @@ -120,13 +117,7 @@ tape( 'the function returns the variance of an F distribution', function test( t
d2 = data.d2;
for ( i = 0; i < expected.length; i++ ) {
y = variance( d1[i], d2[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'd1: '+d1[i]+', d2: '+d2[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 1.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. d1: '+d1[i]+'. d2: '+d2[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ var resolve = require( 'path' ).resolve;
var tape = require( 'tape' );
var tryRequire = require( '@stdlib/utils/try-require' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );
var abs = require( '@stdlib/math/base/special/abs' );
var PINF = require( '@stdlib/constants/float64/pinf' );
var NINF = require( '@stdlib/constants/float64/ninf' );
var EPS = require( '@stdlib/constants/float64/eps' );
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );


// FIXTURES //
Expand Down Expand Up @@ -117,8 +116,6 @@ tape( 'if provided `d2 <= 4`, the function returns `NaN`', opts, function test(

tape( 'the function returns the variance of an F distribution', opts, function test( t ) {
var expected;
var delta;
var tol;
var d1;
var d2;
var i;
Expand All @@ -129,13 +126,7 @@ tape( 'the function returns the variance of an F distribution', opts, function t
d2 = data.d2;
for ( i = 0; i < expected.length; i++ ) {
y = variance( d1[i], d2[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'd1: '+d1[i]+', d2: '+d2[i]+', y: '+y+', expected: '+expected[i] );
} else {
delta = abs( y - expected[ i ] );
tol = 1.0 * EPS * abs( expected[ i ] );
t.ok( delta <= tol, 'within tolerance. d1: '+d1[i]+'. d2: '+d2[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Loading