You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/base/nanmeanwd/README.md
+4-8Lines changed: 4 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,13 +53,12 @@ var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' );
53
53
54
54
#### nanmeanwd( N, x, strideX )
55
55
56
-
Computes the [arithmetic mean][arithmetic-mean] of a strided array`x`, ignoring `NaN` values and using Welford's algorithm.
56
+
Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `NaN` values and using Welford's algorithm.
57
57
58
58
```javascript
59
59
var x = [ 1.0, -2.0, NaN, 2.0 ];
60
-
varN=x.length;
61
60
62
-
var v =nanmeanwd( N, x, 1 );
61
+
var v =nanmeanwd( x.length, x, 1 );
63
62
// returns ~0.3333
64
63
```
65
64
@@ -98,9 +97,8 @@ Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `Na
98
97
99
98
```javascript
100
99
var x = [ 1.0, -2.0, NaN, 2.0 ];
101
-
varN=x.length;
102
100
103
-
var v =nanmeanwd.ndarray( N, x, 1, 0 );
101
+
var v =nanmeanwd.ndarray( x.length, x, 1, 0 );
104
102
// returns ~0.33333
105
103
```
106
104
@@ -111,8 +109,6 @@ The function has the following additional parameters:
111
109
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the [arithmetic mean][arithmetic-mean] for every other element in the strided array starting from the second element
112
110
113
111
```javascript
114
-
var floor =require( '@stdlib/math/base/special/floor' );
115
-
116
112
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];
117
113
118
114
var v =nanmeanwd.ndarray( 5, x, 2, 1 );
@@ -145,8 +141,8 @@ var v = nanmeanwd.ndarray( 5, x, 2, 1 );
145
141
```javascript
146
142
var uniform =require( '@stdlib/random/base/uniform' );
147
143
var filledarrayBy =require( '@stdlib/array/filled-by' );
148
-
var nanmeanwd =require( '@stdlib/stats/base/nanmeanwd' );
149
144
var bernoulli =require( '@stdlib/random/base/bernoulli' );
145
+
var nanmeanwd =require( '@stdlib/stats/base/nanmeanwd' );
0 commit comments