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/nanvariancech/README.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,23 +119,23 @@ The function has the following parameters:
119
119
The `N` and stride parameters determine which elements in the stided array are accessed at runtime. For example, to compute the [variance][variance] of every other element in `x`,
120
120
121
121
```javascript
122
-
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ];
122
+
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN, NaN ];
123
123
124
-
var v =nanvariancech( 4, 1, x, 2 );
124
+
var v =nanvariancech( 5, 1, x, 2 );
125
125
// returns 6.25
126
126
```
127
127
128
128
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
var x0 =newFloat64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
135
+
var x0 =newFloat64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
136
136
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
137
137
138
-
var v =nanvariancech( 4, 1, x1, 2 );
138
+
var v =nanvariancech( 5, 1, x1, 2 );
139
139
// returns 6.25
140
140
```
141
141
@@ -175,7 +175,7 @@ var v = nanvariancech.ndarray( 5, 1, x, 2, 1 );
175
175
- If `n - c` is less than or equal to `0` (where `c` corresponds to the provided degrees of freedom adjustment and `n` corresponds to the number of non-`NaN` indexed elements), both functions return `NaN`.
176
176
- The underlying algorithm is a specialized case of Neely's two-pass algorithm. As the variance is invariant with respect to changes in the location parameter, the underlying algorithm uses the first non-`NaN` strided array element as a trial mean to shift subsequent data values and thus mitigate catastrophic cancellation. Accordingly, the algorithm's accuracy is best when data is **unordered** (i.e., the data is **not** sorted in either ascending or descending order such that the first value is an "extreme" value).
177
177
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
178
-
- Depending on the environment, the typed versions ([`dnanvariancech`][@stdlib/stats/base/dnanvariancech], [`snanvariancech`][@stdlib/stats/base/snanvariancech], etc.) are likely to be significantly more performant.
178
+
- Depending on the environment, the typed versions ([`dnanvariancech`][@stdlib/stats/strided/dnanvariancech], [`snanvariancech`][@stdlib/stats/base/snanvariancech], etc.) are likely to be significantly more performant.
179
179
180
180
</section>
181
181
@@ -234,7 +234,7 @@ console.log( v );
234
234
235
235
## See Also
236
236
237
-
- <spanclass="package-name">[`@stdlib/stats/base/dnanvariancech`][@stdlib/stats/base/dnanvariancech]</span><spanclass="delimiter">: </span><spanclass="description">calculate the variance of a double-precision floating-point strided array ignoring NaN values and using a one-pass trial mean algorithm.</span>
237
+
- <spanclass="package-name">[`@stdlib/stats/strided/dnanvariancech`][@stdlib/stats/strided/dnanvariancech]</span><spanclass="delimiter">: </span><spanclass="description">calculate the variance of a double-precision floating-point strided array ignoring NaN values and using a one-pass trial mean algorithm.</span>
238
238
- <spanclass="package-name">[`@stdlib/stats/base/nanstdevch`][@stdlib/stats/base/nanstdevch]</span><spanclass="delimiter">: </span><spanclass="description">calculate the standard deviation of a strided array ignoring NaN values and using a one-pass trial mean algorithm.</span>
239
239
- <spanclass="package-name">[`@stdlib/stats/base/nanvariance`][@stdlib/stats/base/nanvariance]</span><spanclass="delimiter">: </span><spanclass="description">calculate the variance of a strided array ignoring NaN values.</span>
240
240
- <spanclass="package-name">[`@stdlib/stats/base/snanvariancech`][@stdlib/stats/base/snanvariancech]</span><spanclass="delimiter">: </span><spanclass="description">calculate the variance of a single-precision floating-point strided array ignoring NaN values and using a one-pass trial mean algorithm.</span>
0 commit comments