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/dsnanmean/README.md
+16-24Lines changed: 16 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,36 +51,33 @@ The [arithmetic mean][arithmetic-mean] is defined as
51
51
var dsnanmean =require( '@stdlib/stats/base/dsnanmean' );
52
52
```
53
53
54
-
#### dsnanmean( N, x, stride )
54
+
#### dsnanmean( N, x, strideX )
55
55
56
56
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array `x`, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`,
73
+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [arithmetic mean][arithmetic-mean] of every other element in `x`,
var floor =require( '@stdlib/math/base/special/floor' );
79
77
80
78
var x =newFloat32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ] );
81
-
varN=floor( x.length/2 );
82
79
83
-
var v =dsnanmean( N, x, 2 );
80
+
var v =dsnanmean( 4, x, 2 );
84
81
// returns 1.25
85
82
```
86
83
@@ -95,40 +92,35 @@ var floor = require( '@stdlib/math/base/special/floor' );
95
92
var x0 =newFloat32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
96
93
var x1 =newFloat32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
97
94
98
-
varN=floor( x0.length/2 );
99
-
100
-
var v =dsnanmean( N, x1, 2 );
95
+
var v =dsnanmean( 4, x1, 2 );
101
96
// returns 1.25
102
97
```
103
98
104
-
#### dsnanmean.ndarray( N, x, stride, offset )
99
+
#### dsnanmean.ndarray( N, x, strideX, offsetX )
105
100
106
101
Computes the [arithmetic mean][arithmetic-mean] of a single-precision floating-point strided array, ignoring `NaN` values and using extended accumulation and alternative indexing semantics.
var x =newFloat32Array( [ 1.0, -2.0, NaN, 2.0 ] );
112
-
varN=x.length;
113
107
114
-
var v =dsnanmean.ndarray( N, x, 1, 0 );
108
+
var v =dsnanmean.ndarray( x.length, x, 1, 0 );
115
109
// returns ~0.33333
116
110
```
117
111
118
112
The function has the following additional parameters:
119
113
120
-
-**offset**: starting index for `x`.
114
+
-**offsetX**: starting index for `x`.
121
115
122
-
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 value in `x` starting from the second value
116
+
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 `x` starting from the second element
var floor =require( '@stdlib/math/base/special/floor' );
127
120
128
121
var x =newFloat32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
129
-
varN=floor( x.length/2 );
130
122
131
-
var v =dsnanmean.ndarray( N, x, 2, 1 );
123
+
var v =dsnanmean.ndarray( 4, x, 2, 1 );
132
124
// returns 1.25
133
125
```
134
126
@@ -193,12 +185,12 @@ console.log( v );
193
185
194
186
#### stdlib_strided_dsnanmean( N, \*X, strideX )
195
187
196
-
Calculate the Arithmetic Mean value of a double-precision floating-point strided array, ignoring `NaN` values.
188
+
Computes the Arithmetic Mean of a single-precision floating-point strided array`x`, ignoring `NaN` values, using extended accumulation, and returning an extended precision result.
#### stdlib_strided_dsnanmean_ndarray( N, \*X, strideX, offsetX )
216
208
217
-
Computes the Arithmetic Mean value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
209
+
Computes the arithmetic mean of a single-precision floating-point strided array, ignoring `NaN` values and using extended accumulation and alternative indexing semantics.
0 commit comments