Skip to content

feat: add stats/incr/nanrmse #5979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: add stats/incr/nanrmse
  • Loading branch information
hrshya committed Mar 11, 2025
commit d7e7a10a96a4872f47f0db359da6c9f91eeda01c
13 changes: 9 additions & 4 deletions lib/node_modules/@stdlib/stats/incr/nanrmse/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var sqrt = require( '@stdlib/math/base/special/sqrt' );
var EPS = require( '@stdlib/constants/float64/eps' );
var incrnanrmse = require( './../lib' );
var isnan = require( '@stdlib/math/base/assert/is-nan' );

Check failure on line 28 in lib/node_modules/@stdlib/stats/incr/nanrmse/test/test.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

`require( '@stdlib/math/base/assert/is-nan' )` should come before `require( './../lib' )`


// TESTS //
Expand Down Expand Up @@ -60,14 +60,15 @@
var x;
var y;
var i;
var c;

data = [
[ 2.0, 3.0 ],
[ 3.0, -1.0 ],
[ 2.0, 5.0 ],
[ NaN, 2.0 ],
[ 4.0, -4.0 ],
[ 1.0, NaN ],
[ 4.0, -4.0 ],
[ NaN, 2.0 ],
[ 3.0, 0.0 ],
[ -4.0, 5.0 ]
];
Expand All @@ -76,14 +77,18 @@
acc = incrnanrmse();

sum = 0;
c = 0;
for ( i = 0; i < N; i++ ) {
x = data[ i ][ 0 ];
y = data[ i ][ 1 ];
if ( isnan( d ) === false ) {
if ( isnan( x ) === false && isnan( y ) === false ) {
r = y - x;
sum += r * r;
c += 1;
expected = sqrt( sum/c );
} else {
expected = sqrt( sum/c );
}
expected = sqrt( sum/(i+1) );
actual = acc( x, y );
if ( actual === expected ) {
t.equal( actual, expected, 'returns expected value' );
Expand Down
Loading