Skip to content

Commit 70cece2

Browse files
committed
added nanmrss
1 parent ea2a0bb commit 70cece2

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

lib/node_modules/@stdlib/stats/incr/nanmrss/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ accumulator = incrnanmrss( 5 );
138138

139139
// For each simulated datum, update the moving residual sum of squares...
140140
for ( i = 0; i < 100; i++ ) {
141-
v1 = ( bernoulli( 0.8 ) < 1 ) ? NaN : uniform( 0.0, 100.0 );
141+
v1 = ( bernoulli( 0.8 ) < 1 ) ? NaN : uniform( 0.0, 100.0 );
142142
v2 = ( bernoulli( 0.8 ) < 1 ) ? NaN : uniform( 0.0, 100.0 );
143-
accumulator( v1, v2 );
143+
accumulator( v1, v2 );
144144
}
145145
console.log( accumulator() );
146146
```

lib/node_modules/@stdlib/stats/incr/nanmrss/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type accumulator = ( x?: number, y?: number ) => number | null;
5353
*
5454
* r = accumulator( 2.0, 3.0 );
5555
* // returns 1.0
56-
*
56+
*
5757
* r = accumulator( NaN, NaN );
5858
* // returns 1.0
5959
*

lib/node_modules/@stdlib/stats/incr/nanmrss/lib/main.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ function incrnanmrss( W ) {
7777
*/
7878
function accumulator( x, y ) {
7979
if ( arguments.length === 0 ){
80-
return mrss();
81-
}
82-
if ( isnan( x ) || isnan( y ) ) {
83-
return mrss();
84-
}
85-
return mrss( isnan(x) ? 0 : x, isnan(y) ? 0 : y );
80+
return mrss();
81+
}
82+
if ( isnan( x ) || isnan( y ) ) {
83+
return mrss();
84+
}
85+
return mrss( (isnan(x) ? 0 : x), (isnan(y) ? 0 : y) );
8686
}
8787
}
8888

lib/node_modules/@stdlib/stats/incr/nanmrss/test/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ tape( 'the accumulator function computes a moving residual sum of squares increm
8181

8282
data = [
8383
[ 2.0, 3.0 ],
84-
[ NaN, 3.0 ],
84+
[ NaN, 3.0 ],
8585
[ 2.0, NaN ],
8686
[ 3.0, -1.0 ],
8787
[ 2.0, 5.0 ],
8888
[ 4.0, -4.0 ],
89-
[ NaN, NaN ],
89+
[ NaN, NaN ],
9090
[ 3.0, 0.0 ],
9191
[ -4.0, 5.0 ]
9292
];
@@ -115,9 +115,9 @@ tape( 'if not provided an input value, the accumulator function returns the curr
115115

116116
data = [
117117
[ 2.0, 3.0 ],
118-
[ NaN, 5.0 ],
118+
[ NaN, 5.0 ],
119119
[ 3.0, -5.0 ],
120-
[ 1.0, NaN ],
120+
[ 1.0, NaN ],
121121
[ 1.0, 10.0 ]
122122
];
123123
acc = incrnanmrss( 2 );

0 commit comments

Comments
 (0)