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/dnanmeanors/README.md
+120-24
Original file line number
Diff line number
Diff line change
@@ -51,84 +51,79 @@ The [arithmetic mean][arithmetic-mean] is defined as
51
51
var dnanmeanors =require( '@stdlib/stats/base/dnanmeanors' );
52
52
```
53
53
54
-
#### dnanmeanors( N, x, stride )
54
+
#### dnanmeanors( N, x, strideX )
55
55
56
56
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array `x`, ignoring `NaN` values and using ordinary recursive summation.
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`,
73
74
74
-
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`,
var floor =require( '@stdlib/math/base/special/floor' );
94
92
95
-
var x0 =newFloat64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
93
+
var x0 =newFloat64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
96
94
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
97
95
98
-
varN=floor( x0.length/2 );
99
-
100
-
var v =dnanmeanors( N, x1, 2 );
96
+
var v =dnanmeanors( 5, x1, 2 );
101
97
// returns 1.25
102
98
```
103
99
104
-
#### dnanmeanors.ndarray( N, x, stride, offset )
100
+
#### dnanmeanors.ndarray( N, x, strideX, offsetX )
105
101
106
102
Computes the [arithmetic mean][arithmetic-mean] of a double-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
var x =newFloat64Array( [ 1.0, -2.0, NaN, 2.0 ] );
112
-
varN=x.length;
113
108
114
-
var v =dnanmeanors.ndarray( N, x, 1, 0 );
109
+
var v =dnanmeanors.ndarray( x.length, x, 1, 0 );
115
110
// returns ~0.33333
116
111
```
117
112
118
113
The function has the following additional parameters:
119
114
120
-
-**offset**: starting index for `x`.
115
+
-**offsetX**: starting index for `x`.
116
+
117
+
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
121
118
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
#### stdlib_strided_dnanmeanors_ndarray( N, \*X, strideX, offsetX )
211
+
212
+
Computes the arithmetic mean of a double-precision floating-point strided array, ignoring `NaN` values and using ordinary recursive summation and alternative indexing semantics.
0 commit comments