Skip to content

Commit 064e1d2

Browse files
committed
docs: update README
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent bc3cd78 commit 064e1d2

File tree

1 file changed

+4
-8
lines changed
  • lib/node_modules/@stdlib/stats/base/nanmeanwd

1 file changed

+4
-8
lines changed

lib/node_modules/@stdlib/stats/base/nanmeanwd/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,12 @@ var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' );
5353

5454
#### nanmeanwd( N, x, strideX )
5555

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.
5757

5858
```javascript
5959
var x = [ 1.0, -2.0, NaN, 2.0 ];
60-
var N = x.length;
6160

62-
var v = nanmeanwd( N, x, 1 );
61+
var v = nanmeanwd( x.length, x, 1 );
6362
// returns ~0.3333
6463
```
6564

@@ -98,9 +97,8 @@ Computes the [arithmetic mean][arithmetic-mean] of a strided array, ignoring `Na
9897

9998
```javascript
10099
var x = [ 1.0, -2.0, NaN, 2.0 ];
101-
var N = x.length;
102100

103-
var v = nanmeanwd.ndarray( N, x, 1, 0 );
101+
var v = nanmeanwd.ndarray( x.length, x, 1, 0 );
104102
// returns ~0.33333
105103
```
106104

@@ -111,8 +109,6 @@ The function has the following additional parameters:
111109
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
112110

113111
```javascript
114-
var floor = require( '@stdlib/math/base/special/floor' );
115-
116112
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];
117113

118114
var v = nanmeanwd.ndarray( 5, x, 2, 1 );
@@ -145,8 +141,8 @@ var v = nanmeanwd.ndarray( 5, x, 2, 1 );
145141
```javascript
146142
var uniform = require( '@stdlib/random/base/uniform' );
147143
var filledarrayBy = require( '@stdlib/array/filled-by' );
148-
var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' );
149144
var bernoulli = require( '@stdlib/random/base/bernoulli' );
145+
var nanmeanwd = require( '@stdlib/stats/base/nanmeanwd' );
150146

151147
function rand() {
152148
if ( bernoulli( 0.8 ) < 1 ) {

0 commit comments

Comments
 (0)