diff --git a/lib/node_modules/@stdlib/stats/base/meanpn/lib/ndarray.js b/lib/node_modules/@stdlib/stats/base/meanpn/lib/ndarray.js index 0707013def95..8243645ac94e 100644 --- a/lib/node_modules/@stdlib/stats/base/meanpn/lib/ndarray.js +++ b/lib/node_modules/@stdlib/stats/base/meanpn/lib/ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2024 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,6 +53,19 @@ var gapxsumpw = require( '@stdlib/blas/ext/base/gapxsumpw' ).ndarray; * var v = meanpn( N, x, 2, 1 ); * // returns 1.25 */ + +// cspell:ignore meanpn + +/** +* Computes the arithmetic mean of a strided array using a two-pass error correction algorithm. +* +* @private +* @param {PositiveInteger} N - number of indexed elements +* @param {NumericArray} x - input array +* @param {integer} stride - stride length +* @param {NonNegativeInteger} offset - starting index +* @returns {number} arithmetic mean +*/ function meanpn( N, x, stride, offset ) { var mu; var c; @@ -63,7 +76,7 @@ function meanpn( N, x, stride, offset ) { if ( N === 1 || stride === 0 ) { return x[ offset ]; } - // Compute an estimate for the meanpn: + // Compute an estimate for the mean: mu = gsumpw( N, x, stride, offset ) / N; // Compute an error term: