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 @@ -256,11 +256,7 @@ tape( 'the created function evaluates the pdf for `x` given parameters `mu` and
for ( i = 0; i < x.length; i++ ) {
pdf = factory( mu[i], lambda[i] );
y = pdf( x[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', mu: '+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 1500 ), 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 1500 ), true, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,7 @@ tape( 'the function evaluates the pdf for `x` given parameters `mu` and `lambda`
lambda = data.lambda;
for ( i = 0; i < x.length; i++ ) {
y = pdf( x[i], mu[i], lambda[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 1500 ), 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 1500 ), true, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,7 @@ tape( 'the function evaluates the pdf for `x` given parameters `mu` and `lambda`
lambda = data.lambda;
for ( i = 0; i < x.length; i++ ) {
y = pdf( x[i], mu[i], lambda[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'x: '+x[i]+', mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 1500 ), 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 1500 ), true, 'within tolerance. x: '+x[ i ]+'. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ tape( 'the function returns the skewness of a Wald distribution', function test(
lambda = data.lambda;
for ( i = 0; i < mu.length; i++ ) {
y = skewness( mu[i], lambda[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 20 ), 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 20 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ tape( 'the function returns the skewness of a Wald distribution', opts, function
lambda = data.lambda;
for ( i = 0; i < mu.length; i++ ) {
y = skewness( mu[i], lambda[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 20 ), 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 20 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,7 @@ tape( 'the function returns the variance of a Wald distribution', function test(
lambda = data.lambda;
for ( i = 0; i < mu.length; i++ ) {
y = variance( mu[i], lambda[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 20 ), 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 20 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ tape( 'the function returns the variance of a Wald distribution', opts, function
lambda = data.lambda;
for ( i = 0; i < mu.length; i++ ) {
y = variance( mu[i], lambda[i] );
if ( y === expected[i] ) {
t.strictEqual( y, expected[i], 'mu:'+mu[i]+', lambda: '+lambda[i]+', y: '+y+', expected: '+expected[i] );
} else {
t.ok( isAlmostSameValue( y, expected[i], 20 ), 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.strictEqual( isAlmostSameValue( y, expected[i], 20 ), true, 'within tolerance. mu: '+mu[i]+'. lambda: '+lambda[i]+'. y: '+y+'. E: '+expected[ i ]+'.' );
}
t.end();
});