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
* Licensed under the Apache License, Version 2.0 (the "License");
190
+
* you may not use this file except in compliance with the License.
191
+
* You may obtain a copy of the License at
192
+
*
193
+
* http://www.apache.org/licenses/LICENSE-2.0
194
+
*
195
+
* Unless required by applicable law or agreed to in writing, software
196
+
* distributed under the License is distributed on an "AS IS" BASIS,
197
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198
+
* See the License for the specific language governing permissions and
199
+
* limitations under the License.
200
+
*/
201
+
202
+
'use strict';
203
+
204
+
// MODULES //
205
+
206
+
var dvariancewd = require( '@stdlib/stats/base/dvariancewd' );
207
+
var sqrt = require( '@stdlib/math/base/special/sqrt' );
208
+
209
+
210
+
// MAIN //
211
+
212
+
/**
213
+
* Computes the standard deviation of a double-precision floating-point strided array using Welford's algorithm.
214
+
*
215
+
* ## References
216
+
*
217
+
* - Welford, B. P. 1962. "Note on a Method for Calculating Corrected Sums of Squares and Products." _Technometrics_ 4 (3). Taylor & Francis: 419–20. doi:[10.1080/00401706.1962.10490022](https://doi.org/10.1080/00401706.1962.10490022).
218
+
* - van Reeken, A. J. 1968. "Letters to the Editor: Dealing with Neely's Algorithms." _Communications of the ACM_ 11 (3): 149–50. doi:[10.1145/362929.362961](https://doi.org/10.1145/362929.362961).
219
+
*
220
+
* @param {PositiveInteger} N - number of indexed elements
221
+
* @param {number} correction - degrees of freedom adjustment
222
+
* @param {Float64Array} x - input array
223
+
* @param {integer} stride - stride length
224
+
* @returns {number} standard deviation
225
+
*
226
+
* @example
227
+
* var Float64Array = require( '@stdlib/array/float64' );
228
+
*
229
+
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
230
+
* var N = x.length;
231
+
*
232
+
* var v = dstdevwd( N, 1, x, 1 );
233
+
* // returns ~2.0817
234
+
*/
235
+
function dstdevwd( N, correction, x, stride ) {
236
+
return sqrt( dvariancewd( N, correction, x, stride ) );
237
+
}
238
+
239
+
240
+
// EXPORTS //
241
+
242
+
module.exports = dstdevwd;
243
+
</pre></td></tr></table></pre>
244
+
245
+
<divclass='push'></div><!-- for sticky footer -->
246
+
</div><!-- /wrapper -->
247
+
<divclass='footer quiet pad2 space-top1 center small'>
0 commit comments