Repository: stdlib-js/stdlib (2025-07-08T18:27:46Z)

Issue:
[RFC]: refactor and add protocol support to `stats/base/nanstdevwd`
## Description

This RFC proposes refactoring and adding accessor protocol support to [`@stdlib/stats/base/nanstdevwd`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/nanstdevwd).

For background on the accessor protocol, see https://blog.stdlib.io/introducing-the-accessor-protocol-for-array-like-objects/.

Examples of what we are looking for:

- `stats/base/min`: https://github.com/stdlib-js/stdlib/commit/fbb31fbaafbbbf233740a41a88a57f4db1cb427b ([package](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/min))
- `stats/base/cumax`: https://github.com/stdlib-js/stdlib/commit/11f1341134c5d6c7c0ecd82c99dff766e08e731a ([package](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/cumax))
- `stats/base/cumin`: https://github.com/stdlib-js/stdlib/commit/528efd8000eb7b910f64e63796a8a7c2fdfa03cd ([package](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/cumin))
- `stats/base/mediansorted`: https://github.com/stdlib-js/stdlib/commit/065f86535e3f1915160f91820f1fa0af79633b72 ([package](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/mediansorted))
- `stats/base/mskmax`: https://github.com/stdlib-js/stdlib/commit/417e65361234ec46382f58cc303a544f5bbcbf9e ([package](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/mskmax))

While the changes proposed in this RFC will **not** match the implementations found in the above packages, the packages should provide a conceptual idea of what is desired. Do **not** simply copy-paste the code found in those packages without reasoning about expected behavior and API design.

### Key Points

#### Refactoring

When refactoring and cleaning up existing implementations, pay special attention to the changes made in the commits referred to above. You'll need to go line-by-line in [`@stdlib/stats/base/nanstdevwd`](https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/stats/base/nanstdevwd) and compare with the changes made in the above commits.

In particular, we're interested in

1. standardizing language in descriptions so that all packages in `stats/base` use similar language for describing input parameters and behavior.
2. updating examples to align with current conventions in stdlib.
3. simplifying examples and benchmarks to use utilities for generating random arrays.
4. reducing code duplication by having the main package entry point delegate to the `ndarray` API.

#### Accessor protocol

Prior to adding accessor protocol support, check whether the implementation has any strided array dependencies. For example, for certain algorithms for computing the mean, implementations will depend on algorithms for computing the sum. Ensure that the upstream implementations have support for accessor arrays. If not, you'll need to open a separate PR adding support in the upstream dependencies before working on this package.

When adding support for the accessor protocol, you'll need to do the following:

##### Create an accessors file

Create a new `lib/accessors.js` file. This file will contain an implementation which can handle accessor arrays.

##### Modify the ndarray file

Modify the `lib/ndarray.js` file to delegate to the accessors implementation when one (or more) of the input arrays is an accessor array.

##### Update tests

Modify the tests to include explicit tests for accessor arrays.

#### Run tests and other commands

For each of the following commands, please run them from the root stdlib repository directory (not the package folder!).

To run unit tests,

```bash
make test TESTS_FILTER=".*/stats/base/nanstdevwd/.*"
```

To run examples,

```bash
make examples EXAMPLES_FILTER=".*/stats/base/nanstdevwd/.*"
```

To run benchmarks,

```bash
make benchmark BENCHMARKS_FILTER=".*/stats/base/nanstdevwd/.*"
```

### Create pull request

Provided all tests, examples, and benchmarks successfully execute and pass and that you've updated the package's documentation, you are now ready to open a pull request!

* * *

## Notes

- If you are interested in contributing a PR which addresses this RFC and still getting familiar with our project conventions, please do **not** submit LLM-generated code. Please consult our [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md) and the associated [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/development.md). Failure to respect project conventions will result in your PR being rejected without review. Thank you for understanding!

### Checklist

- [X] I have read and understood the [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md).
- [X] Searched for existing issues and pull requests.
- [X] The issue name begins with `[RFC]:`.



Discussion:
# :wave: Important: PLEASE READ :wave:

This issue has been labeled as a **good first issue** and is available for anyone to work on.

If this is your first time contributing to an open source project, some aspects of the development process may seem unusual, arcane, or some combination of both.

1.  **You cannot "claim" issues.** People new to open source often want to "claim" or be assigned an issue before beginning work. The typical rationale is that people want to avoid wasted work in the event that someone else ends up working the issue. However, this practice is not effective in open source, as it often leads to "issue squatting", in which an individual asks to be assigned, is granted their request, and then never ends up working on the issue. Accordingly, you are encouraged to communicate your intent to address this issue, ideally by providing a rough outline as to how you plan to address the issue or asking clarifying questions, but, at the end of the day, we will take running code and rough consensus in order to move forward quickly.
2.  **We have a very high bar for contributions.** We have very high standards for contributions and expect all contributions—whether new features, tests, or documentation—to be rigorous, thorough, and complete. Once a pull request is merged into stdlib, that contribution immediately becomes the collective responsibility of all maintainers of stdlib. When we merge code into stdlib, we are saying that we, the maintainers, commit to reviewing subsequent changes and making bugfixes to the code. Hence, in order to ensure future maintainability, this naturally leads to a higher standard of contribution.

Before working on this issue and opening a pull request, please read the project's [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md). These guidelines and the associated [development guide](https://github.com/stdlib-js/stdlib/blob/develop/docs/contributing/development.md) provide important information, including links to stdlib's [Code of Conduct](https://github.com/stdlib-js/stdlib/blob/develop/CODE_OF_CONDUCT.md), license policy, and steps for setting up your local development environment.

To reiterate, we **strongly** encourage you to refer to our contributing guides **before** beginning work on this issue. Failure to follow our guidelines significantly decreases the likelihood that you'll successfully contribute to stdlib and may result in automatic closure of a pull request without review.

Setting up your local development environment is a critical first step, as doing so ensures that automated development processes for linting, license verification, and unit testing can run prior to authoring commits and pushing changes. If you would prefer to avoid manual setup, we provide pre-configured [development containers](https://github.com/stdlib-js/stdlib/tree/develop/.devcontainer) for use locally or in GitHub Codespaces.

We place a high value on consistency throughout the stdlib codebase. We encourage you to closely examine other packages in stdlib and attempt to emulate the practices and conventions found therein.

-   If you are attempting to contribute a new package, sometimes the best approach is to simply copy the contents of an existing package and then modify the minimum amount necessary to implement the feature (e.g., changing descriptions, parameter names, and implementation).
-   If you are contributing tests, find a package implementing a similar feature and emulate the tests of that package.
-   If you are updating documentation, examine several similar packages and emulate the content, style, and prose of those packages.

In short, the more effort you put in to ensure that your contribution looks and feels like stdlib—including variables names, bracket spacing, line breaks, etc—the more likely that your contribution will be reviewed and ultimately accepted. We encourage you to closely study the codebase **before** beginning work on this issue.

:sparkles: Thank you again for your interest in stdlib, and we look forward to reviewing your future contributions. :sparkles:




Patch:
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md b/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md
index dae5737e7a80..3c0fa4d67581 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/README.md
@@ -98,9 +98,9 @@ The use of the term `n-1` is commonly referred to as Bessel's correction. Note,
 var nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' );
 ```
 
-#### nanstdevwd( N, correction, x, stride )
+#### nanstdevwd( N, correction, x, strideX )
 
-Computes the [standard deviation][standard-deviation] of a strided array `x` ignoring `NaN` values and using Welford's algorithm.
+Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using Welford's algorithm.
 
 ```javascript
 var x = [ 1.0, -2.0, NaN, 2.0 ];
@@ -114,38 +114,32 @@ The function has the following parameters:
 -   **N**: number of indexed elements.
 -   **correction**: degrees of freedom adjustment. Setting this parameter to a value other than `0` has the effect of adjusting the divisor during the calculation of the [standard deviation][standard-deviation] according to `N-c` where `c` corresponds to the provided degrees of freedom adjustment. When computing the [standard deviation][standard-deviation] of a population, setting this parameter to `0` is the standard choice (i.e., the provided array contains data constituting an entire population). When computing the corrected sample [standard deviation][standard-deviation], setting this parameter to `1` is the standard choice (i.e., the provided array contains data sampled from a larger population; this is commonly referred to as Bessel's correction).
 -   **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
--   **stride**: index increment for `x`.
+-   **strideX**: stride length for `x`.
 
 The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [standard deviation][standard-deviation] of every other element in `x`,
 
 ```javascript
-var floor = require( '@stdlib/math/base/special/floor' );
-
 var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0, NaN ];
-var N = floor( x.length / 2 );
 
-var v = nanstdevwd( N, 1, x, 2 );
+var v = nanstdevwd( 5, 1, x, 2 );
 // returns 2.5
 ```
 
 Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
 
-<!-- eslint-disable stdlib/capitalized-comments -->
+<!-- eslint-disable stdlib/capitalized-comments, max-len -->
 
 ```javascript
 var Float64Array = require( '@stdlib/array/float64' );
-var floor = require( '@stdlib/math/base/special/floor' );
 
-var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN ] );
+var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ] );
 var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
 
-var N = floor( x0.length / 2 );
-
-var v = nanstdevwd( N, 1, x1, 2 );
+var v = nanstdevwd( 5, 1, x1, 2 );
 // returns 2.5
 ```
 
-#### nanstdevwd.ndarray( N, correction, x, stride, offset )
+#### nanstdevwd.ndarray( N, correction, x, strideX, offsetX )
 
 Computes the [standard deviation][standard-deviation] of a strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics.
 
@@ -158,17 +152,14 @@ var v = nanstdevwd.ndarray( x.length, 1, x, 1, 0 );
 
 The function has the following additional parameters:
 
--   **offset**: starting index for `x`.
+-   **offsetX**: starting index for `x`.
 
-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 [standard deviation][standard-deviation] for every other value in `x` starting from the second value
+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 [standard deviation][standard-deviation] for every other element in `x` starting from the second element
 
 ```javascript
-var floor = require( '@stdlib/math/base/special/floor' );
+var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];
 
-var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
-var N = floor( x.length / 2 );
-
-var v = nanstdevwd.ndarray( N, 1, x, 2, 1 );
+var v = nanstdevwd.ndarray( 5, 1, x, 2, 1 );
 // returns 2.5
 ```
 
@@ -182,6 +173,7 @@ var v = nanstdevwd.ndarray( N, 1, x, 2, 1 );
 
 -   If `N <= 0`, both functions return `NaN`.
 -   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`.
+-   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]).
 -   Depending on the environment, the typed versions ([`dnanstdevwd`][@stdlib/stats/strided/dnanstdevwd], [`snanstdevwd`][@stdlib/stats/base/snanstdevwd], etc.) are likely to be significantly more performant.
 
 </section>
@@ -195,18 +187,19 @@ var v = nanstdevwd.ndarray( N, 1, x, 2, 1 );
 <!-- eslint no-undef: "error" -->
 
 ```javascript
-var randu = require( '@stdlib/random/base/randu' );
-var round = require( '@stdlib/math/base/special/round' );
-var Float64Array = require( '@stdlib/array/float64' );
+var uniform = require( '@stdlib/random/base/uniform' );
+var filledarrayBy = require( '@stdlib/array/filled-by' );
+var bernoulli = require( '@stdlib/random/base/bernoulli' );
 var nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' );
 
-var x;
-var i;
-
-x = new Float64Array( 10 );
-for ( i = 0; i < x.length; i++ ) {
-    x[ i ] = round( (randu()*100.0) - 50.0 );
+function rand() {
+    if ( bernoulli( 0.8 ) < 1 ) {
+        return NaN;
+    }
+    return uniform( -50.0, 50.0 );
 }
+
+var x = filledarrayBy( 10, 'float64', rand );
 console.log( x );
 
 var v = nanstdevwd( x.length, 1, x, 1 );
@@ -258,6 +251,8 @@ console.log( v );
 
 [mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
 
+[@stdlib/array/base/accessor]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/base/accessor
+
 [@welford:1962a]: https://doi.org/10.1080/00401706.1962.10490022
 
 [@vanreeken:1968a]: https://doi.org/10.1145/362929.362961
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.js
index 122f56f179b5..2ec9b6dd32ad 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.js
@@ -21,15 +21,30 @@
 // MODULES //
 
 var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
+var uniform = require( '@stdlib/random/base/uniform' );
+var bernoulli = require( '@stdlib/random/base/bernoulli' );
+var filledarrayBy = require( '@stdlib/array/filled-by' );
 var isnan = require( '@stdlib/math/base/assert/is-nan' );
 var pow = require( '@stdlib/math/base/special/pow' );
 var pkg = require( './../package.json' ).name;
-var nanstdevwd = require( './../lib/nanstdevwd.js' );
+var nanstdevwd = require( './../lib/main.js' );
 
 
 // FUNCTIONS //
 
+/**
+* Returns a random number.
+*
+* @private
+* @returns {number} random number
+*/
+function rand() {
+	if ( bernoulli( 0.8 ) < 1 ) {
+		return NaN;
+	}
+	return uniform( -10.0, 10.0 );
+}
+
 /**
 * Creates a benchmark function.
 *
@@ -38,17 +53,7 @@ var nanstdevwd = require( './../lib/nanstdevwd.js' );
 * @returns {Function} benchmark function
 */
 function createBenchmark( len ) {
-	var x;
-	var i;
-
-	x = [];
-	for ( i = 0; i < len; i++ ) {
-		if ( randu() < 0.2 ) {
-			x.push( NaN );
-		} else {
-			x.push( ( randu()*20.0 ) - 10.0 );
-		}
-	}
+	var x = filledarrayBy( len, 'generic', rand );
 	return benchmark;
 
 	function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.ndarray.js
index 0d73fefff148..9eb9fcb83c2c 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/benchmark/benchmark.ndarray.js
@@ -21,7 +21,9 @@
 // MODULES //
 
 var bench = require( '@stdlib/bench' );
-var randu = require( '@stdlib/random/base/randu' );
+var uniform = require( '@stdlib/random/base/uniform' );
+var bernoulli = require( '@stdlib/random/base/bernoulli' );
+var filledarrayBy = require( '@stdlib/array/filled-by' );
 var isnan = require( '@stdlib/math/base/assert/is-nan' );
 var pow = require( '@stdlib/math/base/special/pow' );
 var pkg = require( './../package.json' ).name;
@@ -30,6 +32,19 @@ var nanstdevwd = require( './../lib/ndarray.js' );
 
 // FUNCTIONS //
 
+/**
+* Returns a random number.
+*
+* @private
+* @returns {number} random number
+*/
+function rand() {
+	if ( bernoulli( 0.8 ) < 1 ) {
+		return NaN;
+	}
+	return uniform( -10.0, 10.0 );
+}
+
 /**
 * Creates a benchmark function.
 *
@@ -38,17 +53,7 @@ var nanstdevwd = require( './../lib/ndarray.js' );
 * @returns {Function} benchmark function
 */
 function createBenchmark( len ) {
-	var x;
-	var i;
-
-	x = [];
-	for ( i = 0; i < len; i++ ) {
-		if ( randu() < 0.2 ) {
-			x.push( NaN );
-		} else {
-			x.push( ( randu()*20.0 ) - 10.0 );
-		}
-	}
+	var x = filledarrayBy( len, 'generic', rand );
 	return benchmark;
 
 	function benchmark( b ) {
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/repl.txt b/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/repl.txt
index 19c36f46f10f..145545804bbe 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/repl.txt
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/repl.txt
@@ -1,10 +1,10 @@
 
-{{alias}}( N, correction, x, stride )
+{{alias}}( N, correction, x, strideX )
     Computes the standard deviation of a strided array ignoring `NaN` values and
     using Welford's algorithm.
 
-    The `N` and `stride` parameters determine which elements in `x` are accessed
-    at runtime.
+    The `N` and stride parameters determine which elements in the strided array
+    are accessed at runtime.
 
     Indexing is relative to the first index. To introduce an offset, use a typed
     array view.
@@ -33,8 +33,8 @@
     x: Array<number>|TypedArray
         Input array.
 
-    stride: integer
-        Index increment.
+    strideX: integer
+        Stride length.
 
     Returns
     -------
@@ -48,20 +48,19 @@
     > {{alias}}( x.length, 1, x, 1 )
     ~2.0817
 
-    // Using `N` and `stride` parameters:
-    > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ];
-    > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
-    > {{alias}}( N, 1, x, 2 )
+    // Using `N` and stride parameters:
+    > x = [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN ];
+    > {{alias}}( 4, 1, x, 2 )
     ~2.0817
 
     // Using view offsets:
-    > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] );
+    > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ] );
     > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
-    > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
-    > {{alias}}( N, 1, x1, 2 )
+    > {{alias}}( 4, 1, x1, 2 )
     ~2.0817
 
-{{alias}}.ndarray( N, correction, x, stride, offset )
+
+{{alias}}.ndarray( N, correction, x, strideX, offsetX )
     Computes the standard deviation of a strided array ignoring `NaN` values and
     using Welford's algorithm and alternative indexing semantics.
 
@@ -89,10 +88,10 @@
     x: Array<number>|TypedArray
         Input array.
 
-    stride: integer
-        Index increment.
+    strideX: integer
+        Stride length.
 
-    offset: integer
+    offsetX: integer
         Starting index.
 
     Returns
@@ -108,9 +107,8 @@
     ~2.0817
 
     // Using offset parameter:
-    > var x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ];
-    > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
-    > {{alias}}.ndarray( N, 1, x, 2, 1 )
+    > x = [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN, NaN ];
+    > {{alias}}.ndarray( 4, 1, x, 2, 1 )
     ~2.0817
 
     See Also
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/index.d.ts b/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/index.d.ts
index d65a6e1f088c..8abeb14349d7 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/index.d.ts
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/index.d.ts
@@ -20,7 +20,12 @@
 
 /// <reference types="@stdlib/types"/>
 
-import { NumericArray } from '@stdlib/types/array';
+import { NumericArray, Collection, AccessorArrayLike } from '@stdlib/types/array';
+
+/**
+* Input array.
+*/
+type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
 
 /**
 * Interface describing `nanstdevwd`.
@@ -32,7 +37,7 @@ interface Routine {
 	* @param N - number of indexed elements
 	* @param correction - degrees of freedom adjustment
 	* @param x - input array
-	* @param stride - stride length
+	* @param strideX - stride length
 	* @returns standard deviation
 	*
 	* @example
@@ -41,7 +46,7 @@ interface Routine {
 	* var v = nanstdevwd( x.length, 1, x, 1 );
 	* // returns ~2.0817
 	*/
-	( N: number, correction: number, x: NumericArray, stride: number ): number;
+	( N: number, correction: number, x: InputArray, strideX: number ): number;
 
 	/**
 	* Computes the standard deviation of a strided array ignoring `NaN` values and using Welford's algorithm and alternative indexing semantics.
@@ -49,8 +54,8 @@ interface Routine {
 	* @param N - number of indexed elements
 	* @param correction - degrees of freedom adjustment
 	* @param x - input array
-	* @param stride - stride length
-	* @param offset - starting index
+	* @param strideX - stride length
+	* @param offsetX - starting index
 	* @returns standard deviation
 	*
 	* @example
@@ -59,7 +64,7 @@ interface Routine {
 	* var v = nanstdevwd.ndarray( x.length, 1, x, 1, 0 );
 	* // returns ~2.0817
 	*/
-	ndarray( N: number, correction: number, x: NumericArray, stride: number, offset: number ): number;
+	ndarray( N: number, correction: number, x: InputArray, strideX: number, offsetX: number ): number;
 }
 
 /**
@@ -68,7 +73,7 @@ interface Routine {
 * @param N - number of indexed elements
 * @param correction - degrees of freedom adjustment
 * @param x - input array
-* @param stride - stride length
+* @param strideX - stride length
 * @returns standard deviation
 *
 * @example
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/examples/index.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/examples/index.js
index c904526b4139..b61ce6981aaf 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/examples/index.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/examples/index.js
@@ -18,22 +18,19 @@
 
 'use strict';
 
-var randu = require( '@stdlib/random/base/randu' );
-var round = require( '@stdlib/math/base/special/round' );
-var Float64Array = require( '@stdlib/array/float64' );
+var uniform = require( '@stdlib/random/base/uniform' );
+var filledarrayBy = require( '@stdlib/array/filled-by' );
+var bernoulli = require( '@stdlib/random/base/bernoulli' );
 var nanstdevwd = require( './../lib' );
 
-var x;
-var i;
-
-x = new Float64Array( 10 );
-for ( i = 0; i < x.length; i++ ) {
-	if ( randu() < 0.2 ) {
-		x[ i ] = NaN;
-	} else {
-		x[ i ] = round( (randu()*100.0) - 50.0 );
+function rand() {
+	if ( bernoulli( 0.8 ) < 1 ) {
+		return NaN;
 	}
+	return uniform( -50.0, 50.0 );
 }
+
+var x = filledarrayBy( 10, 'float64', rand );
 console.log( x );
 
 var v = nanstdevwd( x.length, 1, x, 1 );
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/index.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/index.js
index 7b258fd28fae..cd99da045c5c 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/index.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/index.js
@@ -32,13 +32,11 @@
 * // returns ~2.0817
 *
 * @example
-* var floor = require( '@stdlib/math/base/special/floor' );
 * var nanstdevwd = require( '@stdlib/stats/base/nanstdevwd' );
 *
 * var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];
-* var N = floor( x.length / 2 );
 *
-* var v = nanstdevwd.ndarray( N, 1, x, 2, 1 );
+* var v = nanstdevwd.ndarray( 5, 1, x, 2, 1 );
 * // returns 2.5
 */
 
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/nanstdevwd.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/nanstdevwd.js
index 2a4392866b83..78fd84726b18 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/nanstdevwd.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/nanstdevwd.js
@@ -20,8 +20,8 @@
 
 // MODULES //
 
-var nanvariancewd = require( '@stdlib/stats/base/nanvariancewd' );
-var sqrt = require( '@stdlib/math/base/special/sqrt' );
+var stride2offset = require( '@stdlib/strided/base/stride2offset' );
+var ndarray = require( './ndarray.js' );
 
 
 // MAIN //
@@ -32,7 +32,7 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
 * @param {PositiveInteger} N - number of indexed elements
 * @param {number} correction - degrees of freedom adjustment
 * @param {NumericArray} x - input array
-* @param {integer} stride - stride length
+* @param {integer} strideX - stride length
 * @returns {number} standard deviation
 *
 * @example
@@ -41,8 +41,8 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
 * var v = nanstdevwd( x.length, 1, x, 1 );
 * // returns ~2.0817
 */
-function nanstdevwd( N, correction, x, stride ) {
-	return sqrt( nanvariancewd( N, correction, x, stride ) );
+function nanstdevwd( N, correction, x, strideX ) {
+	return ndarray( N, correction, x, strideX, stride2offset( N, strideX ) );
 }
 
 
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/ndarray.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/ndarray.js
index 2a1d789fa56f..c8d8a50f1e65 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/lib/ndarray.js
@@ -32,21 +32,18 @@ var sqrt = require( '@stdlib/math/base/special/sqrt' );
 * @param {PositiveInteger} N - number of indexed elements
 * @param {number} correction - degrees of freedom adjustment
 * @param {NumericArray} x - input array
-* @param {integer} stride - stride length
-* @param {NonNegativeInteger} offset - starting index
+* @param {integer} strideX - stride length
+* @param {NonNegativeInteger} offsetX - starting index
 * @returns {number} standard deviation
 *
 * @example
-* var floor = require( '@stdlib/math/base/special/floor' );
-*
 * var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0, NaN, NaN ];
-* var N = floor( x.length / 2 );
 *
-* var v = nanstdevwd( N, 1, x, 2, 1 );
+* var v = nanstdevwd( 5, 1, x, 2, 1 );
 * // returns 2.5
 */
-function nanstdevwd( N, correction, x, stride, offset ) {
-	return sqrt( nanvariancewd( N, correction, x, stride, offset ) );
+function nanstdevwd( N, correction, x, strideX, offsetX ) {
+	return sqrt( nanvariancewd( N, correction, x, strideX, offsetX ) );
 }
 
 


Test patch:
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/test.ts b/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/test.ts
index 7769517a8f52..27083a2419ad 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/test.ts
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/docs/types/test.ts
@@ -16,6 +16,7 @@
 * limitations under the License.
 */
 
+import AccessorArray = require( '@stdlib/array/base/accessor' );
 import nanstdevwd = require( './index' );
 
 
@@ -26,6 +27,7 @@ import nanstdevwd = require( './index' );
 	const x = new Float64Array( 10 );
 
 	nanstdevwd( x.length, 1, x, 1 ); // $ExpectType number
+	nanstdevwd( x.length, 1, new AccessorArray( x ), 1 ); // $ExpectType number
 }
 
 // The compiler throws an error if the function is provided a first argument which is not a number...
@@ -101,6 +103,7 @@ import nanstdevwd = require( './index' );
 	const x = new Float64Array( 10 );
 
 	nanstdevwd.ndarray( x.length, 1, x, 1, 0 ); // $ExpectType number
+	nanstdevwd.ndarray( x.length, 1, new AccessorArray( x ), 1, 0 ); // $ExpectType number
 }
 
 // The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.nanstdevwd.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.nanstdevwd.js
index 4077166ddef0..59d6ca193f1b 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.nanstdevwd.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.nanstdevwd.js
@@ -21,10 +21,10 @@
 // MODULES //
 
 var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
 var sqrt = require( '@stdlib/math/base/special/sqrt' );
 var isnan = require( '@stdlib/math/base/assert/is-nan' );
 var Float64Array = require( '@stdlib/array/float64' );
+var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
 var nanstdevwd = require( './../lib/nanstdevwd.js' );
 
 
@@ -95,6 +95,60 @@ tape( 'the function calculates the population standard deviation of a strided ar
 	t.end();
 });
 
+tape( 'the function calculates the population standard deviation of a strided array (ignoring `NaN` values) (accessors)', function test( t ) {
+	var x;
+	var v;
+	var i;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, NaN, 0.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-1) ), 'returns expected value' );
+
+	x = [ 1.0, NaN, NaN, -2.0, NaN, -4.0, NaN, 5.0, NaN, 0.0, 3.0, NaN ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-6) ), 'returns expected value' );
+
+	x = [ -4.0, NaN ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, NaN ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN ];
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ 4.0 ];
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( 100.0 );
+	}
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN ];
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( NaN );
+	}
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'the function calculates the sample standard deviation of a strided array (ignoring `NaN` values)', function test( t ) {
 	var x;
 	var v;
@@ -149,6 +203,60 @@ tape( 'the function calculates the sample standard deviation of a strided array
 	t.end();
 });
 
+tape( 'the function calculates the sample standard deviation of a strided array (ignoring `NaN` values) (accessors)', function test( t ) {
+	var x;
+	var v;
+	var i;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, NaN, 0.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-2) ), 'returns expected value' );
+
+	x = [ 1.0, NaN, NaN, -2.0, NaN, -4.0, NaN, 5.0, NaN, 0.0, 3.0, NaN ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-7) ), 'returns expected value' );
+
+	x = [ -4.0, NaN ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN, NaN ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN ];
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ 4.0 ];
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( 100.0 );
+	}
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN ];
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( NaN );
+	}
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -164,6 +272,21 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
 	t.end();
 });
 
+tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 0, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	v = nanstdevwd( -1, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided an `N` parameter equal to `1`, the function returns a population standard deviation of `0` provided the first element is not `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -181,6 +304,23 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns a populat
 	t.end();
 });
 
+tape( 'if provided an `N` parameter equal to `1`, the function returns a population standard deviation of `0` provided the first element is not `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 0, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided an `N` parameter equal to `1`, the function returns a sample standard deviation equal to `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -198,6 +338,23 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns a sample
 	t.end();
 });
 
+tape( 'if provided an `N` parameter equal to `1`, the function returns a sample standard deviation equal to `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN, 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided a `correction` parameter yielding a correction term less than or equal to `0`, the function returns `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -213,8 +370,22 @@ tape( 'if provided a `correction` parameter yielding a correction term less than
 	t.end();
 });
 
+tape( 'if provided a `correction` parameter yielding a correction term less than or equal to `0`, the function returns `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, x.length, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	v = nanstdevwd( x.length, x.length+1, toAccessorArray( x ), 1 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'the function supports a `stride` parameter', function test( t ) {
-	var N;
 	var x;
 	var v;
 
@@ -231,15 +402,36 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
 		NaN
 	];
 
-	N = floor( x.length / 2 );
-	v = nanstdevwd( N, 1, x, 2 );
+	v = nanstdevwd( 5, 1, x, 2 );
+
+	t.strictEqual( v, 2.5, 'returns expected value' );
+	t.end();
+});
+
+tape( 'the function supports a `stride` parameter (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [
+		1.0,  // 0
+		2.0,
+		2.0,  // 1
+		-7.0,
+		-2.0, // 2
+		3.0,
+		4.0,  // 3
+		2.0,
+		NaN,  // 4
+		NaN
+	];
+
+	v = nanstdevwd( 5, 1, toAccessorArray( x ), 2 );
 
 	t.strictEqual( v, 2.5, 'returns expected value' );
 	t.end();
 });
 
 tape( 'the function supports a negative `stride` parameter', function test( t ) {
-	var N;
 	var x;
 	var v;
 	var i;
@@ -256,9 +448,8 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
 		4.0,  // 0
 		2.0
 	];
-	N = floor( x.length / 2 );
 
-	v = nanstdevwd( N, 1, x, -2 );
+	v = nanstdevwd( 5, 1, x, -2 );
 	t.strictEqual( v, 2.5, 'returns expected value' );
 
 	x = [];
@@ -271,6 +462,37 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
 	t.end();
 });
 
+tape( 'the function supports a negative `stride` parameter (accessors)', function test( t ) {
+	var x;
+	var v;
+	var i;
+
+	x = [
+		NaN,  // 4
+		NaN,
+		1.0,  // 3
+		2.0,
+		2.0,  // 2
+		-7.0,
+		-2.0, // 1
+		3.0,
+		4.0,  // 0
+		2.0
+	];
+
+	v = nanstdevwd( 5, 1, toAccessorArray( x ), -2 );
+	t.strictEqual( v, 2.5, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( 100.0 );
+	}
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), -1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` provided the correction term is not less than `0` and the first element is not `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -293,10 +515,31 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` p
 	t.end();
 });
 
+tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` provided the correction term is not less than `0` and the first element is not `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, x.length, toAccessorArray( x ), 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'the function supports view offsets', function test( t ) {
 	var x0;
 	var x1;
-	var N;
 	var v;
 
 	x0 = new Float64Array([
@@ -314,9 +557,35 @@ tape( 'the function supports view offsets', function test( t ) {
 	]);
 
 	x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
-	N = floor(x1.length / 2);
 
-	v = nanstdevwd( N, 1, x1, 2 );
+	v = nanstdevwd( 5, 1, x1, 2 );
+	t.strictEqual( v, 2.5, 'returns expected value' );
+
+	t.end();
+});
+
+tape( 'the function supports view offsets (accessors)', function test( t ) {
+	var x0;
+	var x1;
+	var v;
+
+	x0 = new Float64Array([
+		2.0,
+		1.0,  // 0
+		2.0,
+		-2.0, // 1
+		-2.0,
+		2.0,  // 2
+		3.0,
+		4.0,  // 3
+		6.0,
+		NaN,  // 4
+		NaN
+	]);
+
+	x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
+
+	v = nanstdevwd( 5, 1, toAccessorArray( x1 ), 2 );
 	t.strictEqual( v, 2.5, 'returns expected value' );
 
 	t.end();
diff --git a/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.ndarray.js b/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.ndarray.js
index cd085c15467f..fe5bd7f70d4b 100644
--- a/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.ndarray.js
+++ b/lib/node_modules/@stdlib/stats/base/nanstdevwd/test/test.ndarray.js
@@ -21,9 +21,9 @@
 // MODULES //
 
 var tape = require( 'tape' );
-var floor = require( '@stdlib/math/base/special/floor' );
 var sqrt = require( '@stdlib/math/base/special/sqrt' );
 var isnan = require( '@stdlib/math/base/assert/is-nan' );
+var toAccessorArray = require( '@stdlib/array/base/to-accessor-array' );
 var nanstdevwd = require( './../lib/ndarray.js' );
 
 
@@ -94,6 +94,60 @@ tape( 'the function calculates the population standard deviation of a strided ar
 	t.end();
 });
 
+tape( 'the function calculates the population standard deviation of a strided array (ignoring `NaN` values) (accessors)', function test( t ) {
+	var x;
+	var v;
+	var i;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, NaN, 0.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-1) ), 'returns expected value' );
+
+	x = [ 1.0, NaN, NaN, -2.0, NaN, -4.0, NaN, 5.0, NaN, 0.0, 3.0, NaN ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-6) ), 'returns expected value' );
+
+	x = [ -4.0, NaN ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, NaN ];
+
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN ];
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ 4.0 ];
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( 100.0 );
+	}
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN ];
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( NaN );
+	}
+	v = nanstdevwd( x.length, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'the function calculates the sample standard deviation of a strided array (ignoring `NaN` values)', function test( t ) {
 	var x;
 	var v;
@@ -148,6 +202,60 @@ tape( 'the function calculates the sample standard deviation of a strided array
 	t.end();
 });
 
+tape( 'the function calculates the sample standard deviation of a strided array (ignoring `NaN` values) (accessors)', function test( t ) {
+	var x;
+	var v;
+	var i;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, NaN, 0.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-2) ), 'returns expected value' );
+
+	x = [ 1.0, NaN, NaN, -2.0, NaN, -4.0, NaN, 5.0, NaN, 0.0, 3.0, NaN ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, sqrt( 53.5/(x.length-7) ), 'returns expected value' );
+
+	x = [ -4.0, NaN ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN, NaN ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN ];
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ 4.0 ];
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( 100.0 );
+	}
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN ];
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( NaN );
+	}
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -163,6 +271,21 @@ tape( 'if provided an `N` parameter less than or equal to `0`, the function retu
 	t.end();
 });
 
+tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 0, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	v = nanstdevwd( -1, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided an `N` parameter equal to `1`, the function returns a population standard deviation of `0` provided the first element is not `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -180,6 +303,23 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns a populat
 	t.end();
 });
 
+tape( 'if provided an `N` parameter equal to `1`, the function returns a population standard deviation of `0` provided the first element is not `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 0, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided an `N` parameter equal to `1`, the function returns a sample standard deviation equal to `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -197,6 +337,23 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns a sample
 	t.end();
 });
 
+tape( 'if provided an `N` parameter equal to `1`, the function returns a sample standard deviation equal to `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ NaN, 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( 1, 1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided a `correction` parameter yielding a correction term less than or equal to `0`, the function returns `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -212,8 +369,22 @@ tape( 'if provided a `correction` parameter yielding a correction term less than
 	t.end();
 });
 
+tape( 'if provided a `correction` parameter yielding a correction term less than or equal to `0`, the function returns `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, x.length, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	v = nanstdevwd( x.length, x.length+1, toAccessorArray( x ), 1, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'the function supports a `stride` parameter', function test( t ) {
-	var N;
 	var x;
 	var v;
 
@@ -230,15 +401,36 @@ tape( 'the function supports a `stride` parameter', function test( t ) {
 		NaN
 	];
 
-	N = floor( x.length / 2 );
-	v = nanstdevwd( N, 1, x, 2, 0 );
+	v = nanstdevwd( 5, 1, x, 2, 0 );
+
+	t.strictEqual( v, 2.5, 'returns expected value' );
+	t.end();
+});
+
+tape( 'the function supports a `stride` parameter (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [
+		1.0,  // 0
+		2.0,
+		2.0,  // 1
+		-7.0,
+		-2.0, // 2
+		3.0,
+		4.0,  // 3
+		2.0,
+		NaN,  // 4
+		NaN
+	];
+
+	v = nanstdevwd( 5, 1, toAccessorArray( x ), 2, 0 );
 
 	t.strictEqual( v, 2.5, 'returns expected value' );
 	t.end();
 });
 
 tape( 'the function supports a negative `stride` parameter', function test( t ) {
-	var N;
 	var x;
 	var v;
 	var i;
@@ -255,9 +447,8 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
 		4.0,  // 0
 		2.0
 	];
-	N = floor( x.length / 2 );
 
-	v = nanstdevwd( N, 1, x, -2, 8 );
+	v = nanstdevwd( 5, 1, x, -2, 8 );
 	t.strictEqual( v, 2.5, 'returns expected value' );
 
 	x = [];
@@ -270,6 +461,37 @@ tape( 'the function supports a negative `stride` parameter', function test( t )
 	t.end();
 });
 
+tape( 'the function supports a negative `stride` parameter (accessors)', function test( t ) {
+	var x;
+	var v;
+	var i;
+
+	x = [
+		NaN,  // 4
+		NaN,
+		1.0,  // 3
+		2.0,
+		2.0,  // 2
+		-7.0,
+		-2.0, // 1
+		3.0,
+		4.0,  // 0
+		2.0
+	];
+
+	v = nanstdevwd( 5, 1, toAccessorArray( x ), -2, 8 );
+	t.strictEqual( v, 2.5, 'returns expected value' );
+
+	x = [];
+	for ( i = 0; i < 1e3; i++ ) {
+		x.push( 100.0 );
+	}
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), -1, x.length-1 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` provided the correction term is not less than `0` and the first element is not `NaN`', function test( t ) {
 	var x;
 	var v;
@@ -292,8 +514,29 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` p
 	t.end();
 });
 
+tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` provided the correction term is not less than `0` and the first element is not `NaN` (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 0, 0 );
+	t.strictEqual( v, 0.0, 'returns expected value' );
+
+	x = [ NaN, 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, 1, toAccessorArray( x ), 0, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
+
+	v = nanstdevwd( x.length, x.length, toAccessorArray( x ), 0, 0 );
+	t.strictEqual( isnan( v ), true, 'returns expected value' );
+
+	t.end();
+});
+
 tape( 'the function supports an `offset` parameter', function test( t ) {
-	var N;
 	var x;
 	var v;
 
@@ -309,9 +552,31 @@ tape( 'the function supports an `offset` parameter', function test( t ) {
 		NaN,
 		NaN   // 4
 	];
-	N = floor( x.length / 2 );
 
-	v = nanstdevwd( N, 1, x, 2, 1 );
+	v = nanstdevwd( 5, 1, x, 2, 1 );
+	t.strictEqual( v, 2.5, 'returns expected value' );
+
+	t.end();
+});
+
+tape( 'the function supports an `offset` parameter (accessors)', function test( t ) {
+	var x;
+	var v;
+
+	x = [
+		2.0,
+		1.0,  // 0
+		2.0,
+		-2.0, // 1
+		-2.0,
+		2.0,  // 2
+		3.0,
+		4.0,  // 3
+		NaN,
+		NaN   // 4
+	];
+
+	v = nanstdevwd( 5, 1, toAccessorArray( x ), 2, 1 );
 	t.strictEqual( v, 2.5, 'returns expected value' );
 
 	t.end();