Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ tape( 'the function returns the skewness of a bradford distribution', function t
/*
* TODO: the significant divergence from SciPy appears to stem from the computation of the natural log. We should follow up to ensure that our ln implementation is sufficiently accurate.
*/
t.strictEqual( isAlmostSameValue( y, expected[i], 36250 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 36250 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ tape( 'the function returns the skewness of a Bradford distribution', opts, func
/*
* TODO: the significant divergence from SciPy appears to stem from the computation of the natural log. We should follow up to ensure that our ln implementation is sufficiently accurate.
*/
t.strictEqual( isAlmostSameValue( y, expected[i], 36250 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 36250 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tape( 'the created function evaluates the logcdf for `x` given `x0` and `gamma`
for ( i = 0; i < x.length; i++ ) {
logcdf = factory( x0[i], gamma[i] );
y = logcdf( x[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 9 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 9 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -172,7 +172,7 @@ tape( 'the created function evaluates the logcdf for `x` given `x0` and `gamma`
for ( i = 0; i < x.length; i++ ) {
logcdf = factory( x0[i], gamma[i] );
y = logcdf( x[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 12 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 12 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -193,7 +193,7 @@ tape( 'the created function evaluates the logcdf for `x` given `x0` and `gamma`
for ( i = 0; i < x.length; i++ ) {
logcdf = factory( x0[i], gamma[i] );
y = logcdf( x[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 6 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 6 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ tape( 'the function evaluates the logcdf for `x` given `x0` and `gamma` (large `
gamma = largeGamma.gamma;
for ( i = 0; i < x.length; i++ ) {
y = logcdf( x[i], x0[i], gamma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 9 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 9 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -125,7 +125,7 @@ tape( 'the function evaluates the logcdf for `x` given `x0` and `gamma` (`x0 < 0
gamma = negativeMedian.gamma;
for ( i = 0; i < x.length; i++ ) {
y = logcdf( x[i], x0[i], gamma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 12 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 12 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -144,7 +144,7 @@ tape( 'the function evaluates the logcdf for `x` given `x0` and `gamma` (`x0 > 0
gamma = positiveMedian.gamma;
for ( i = 0; i < x.length; i++ ) {
y = logcdf( x[i], x0[i], gamma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 6 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 6 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tape( 'the function evaluates the logcdf for `x` given `x0` and `gamma` (large `
gamma = largeGamma.gamma;
for ( i = 0; i < x.length; i++ ) {
y = logcdf( x[i], x0[i], gamma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 9 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 9 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -134,7 +134,7 @@ tape( 'the function evaluates the logcdf for `x` given `x0` and `gamma` (`x0 < 0
gamma = negativeMedian.gamma;
for ( i = 0; i < x.length; i++ ) {
y = logcdf( x[i], x0[i], gamma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 12 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 12 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -153,7 +153,7 @@ tape( 'the function evaluates the logcdf for `x` given `x0` and `gamma` (`x0 > 0
gamma = positiveMedian.gamma;
for ( i = 0; i < x.length; i++ ) {
y = logcdf( x[i], x0[i], gamma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 6 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 6 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ tape( 'the function returns the expected value of a half-normal distribution', f

for ( i = 0; i < sigma.length; i++ ) {
y = mean( sigma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 0 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tape( 'the function returns the expected value of a half-normal distribution', o

for ( i = 0; i < sigma.length; i++ ) {
y = mean( sigma[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 0 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 0 ), true, 'returns expected value' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ tape( 'the created function evaluates the quantile for `p` given a small range `
for ( i = 0; i < p.length; i++ ) {
quantile = factory( a[i], b[i], c[i] );
y = quantile( p[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -190,7 +190,7 @@ tape( 'the created function evaluates the quantile for `p` given a medium range
for ( i = 0; i < p.length; i++ ) {
quantile = factory( a[i], b[i], c[i] );
y = quantile( p[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -213,7 +213,7 @@ tape( 'the created function evaluates the quantile for `p` given a large range `
for ( i = 0; i < p.length; i++ ) {
quantile = factory( a[i], b[i], c[i] );
y = quantile( p[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
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 @@ -130,7 +130,7 @@ tape( 'the function evaluates the quantile for `x` given a small range `b - a`',
c = smallRange.c;
for ( i = 0; i < p.length; i++ ) {
y = quantile( p[i], a[i], b[i], c[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -151,7 +151,7 @@ tape( 'the function evaluates the quantile for `x` given a medium range `b - a`'
c = mediumRange.c;
for ( i = 0; i < p.length; i++ ) {
y = quantile( p[i], a[i], b[i], c[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -172,7 +172,7 @@ tape( 'the function evaluates the quantile for `x` given a large range `b - a`',
c = largeRange.c;
for ( i = 0; i < p.length; i++ ) {
y = quantile( p[i], a[i], b[i], c[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
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 @@ -121,7 +121,7 @@ tape( 'the function evaluates the quantile for `x` given a small range `b - a`',
c = smallRange.c;
for ( i = 0; i < p.length; i++ ) {
y = quantile( p[i], a[i], b[i], c[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -142,7 +142,7 @@ tape( 'the function evaluates the quantile for `x` given a medium range `b - a`'
c = mediumRange.c;
for ( i = 0; i < p.length; i++ ) {
y = quantile( p[i], a[i], b[i], c[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Expand All @@ -163,7 +163,7 @@ tape( 'the function evaluates the quantile for `x` given a large range `b - a`',
c = largeRange.c;
for ( i = 0; i < p.length; i++ ) {
y = quantile( p[i], a[i], b[i], c[i] );
t.strictEqual( isAlmostSameValue( y, expected[i], 1 ), true, 'returns expected value' );
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
}
t.end();
});
Loading