diff --git a/lib/node_modules/@stdlib/stats/base/dvariancepn/lib/ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dvariancepn/lib/ndarray.native.js index 23d889bc2916..d363f4601601 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancepn/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/base/dvariancepn/lib/ndarray.native.js @@ -38,7 +38,7 @@ var addon = require( './../src/addon.node' ); * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); +* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); * * var v = dvariancepn( 4, 1, x, 2, 1 ); * // returns 6.25 diff --git a/lib/node_modules/@stdlib/stats/base/dvariancepn/src/main.c b/lib/node_modules/@stdlib/stats/base/dvariancepn/src/main.c index 905e11ffa804..191a0f9ed54d 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancepn/src/main.c +++ b/lib/node_modules/@stdlib/stats/base/dvariancepn/src/main.c @@ -73,13 +73,9 @@ double API_SUFFIX(stdlib_strided_dvariancepn_ndarray)( const CBLAS_INT N, const return 0.0; } // Compute an estimate for the mean: - mu = stdlib_strided_dsumpw( N, X, strideX ) / dN; + mu = API_SUFFIX(stdlib_strided_dsumpw_ndarray)( N, X, strideX, offsetX ) / dN; - if ( strideX < 0 ) { - ix = (1-N) * strideX; - } else { - ix = 0; - } + ix = offsetX; // Compute the variance... M2 = 0.0; M = 0.0; diff --git a/lib/node_modules/@stdlib/stats/base/dvariancepn/test/test.ndarray.native.js b/lib/node_modules/@stdlib/stats/base/dvariancepn/test/test.ndarray.native.js index 1a70c493aa74..437e464619b4 100644 --- a/lib/node_modules/@stdlib/stats/base/dvariancepn/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/stats/base/dvariancepn/test/test.ndarray.native.js @@ -188,13 +188,13 @@ tape( 'the function supports an `offset` parameter', opts, function test( t ) { x = new Float64Array([ 1.0, - 2.0, // 0 + 1.0, // 0 2.0, - -7.0, // 1 + -2.0, // 1 -2.0, - 3.0, // 2 - 4.0, - 2.0 // 3 + 2.0, // 2 + 3.0, + 4.0 // 3 ]); v = dvariancepn( 4, 1, x, 2, 1 );