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");
188
+
* you may not use this file except in compliance with the License.
189
+
* You may obtain a copy of the License at
190
+
*
191
+
* http://www.apache.org/licenses/LICENSE-2.0
192
+
*
193
+
* Unless required by applicable law or agreed to in writing, software
194
+
* distributed under the License is distributed on an "AS IS" BASIS,
195
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
196
+
* See the License for the specific language governing permissions and
197
+
* limitations under the License.
198
+
*/
199
+
200
+
'use strict';
201
+
202
+
// MODULES //
203
+
204
+
var dvarianceyc = require( '@stdlib/stats/base/dvarianceyc' );
205
+
var sqrt = require( '@stdlib/math/base/special/sqrt' );
206
+
207
+
208
+
// MAIN //
209
+
210
+
/**
211
+
* Computes the standard deviation of a double-precision floating-point strided array using a one-pass algorithm proposed by Youngs and Cramer.
212
+
*
213
+
* ## References
214
+
*
215
+
* - Youngs, Edward A., and Elliot M. Cramer. 1971. "Some Results Relevant to Choice of Sum and Sum-of-Product Algorithms." _Technometrics_ 13 (3): 657–65. doi:[10.1080/00401706.1971.10488826](https://doi.org/10.1080/00401706.1971.10488826).
216
+
*
217
+
* @param {PositiveInteger} N - number of indexed elements
218
+
* @param {number} correction - degrees of freedom adjustment
219
+
* @param {Float64Array} x - input array
220
+
* @param {integer} stride - stride length
221
+
* @returns {number} standard deviation
222
+
*
223
+
* @example
224
+
* var Float64Array = require( '@stdlib/array/float64' );
225
+
*
226
+
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
227
+
* var N = x.length;
228
+
*
229
+
* var v = dstdevyc( N, 1, x, 1 );
230
+
* // returns ~2.0817
231
+
*/
232
+
function dstdevyc( N, correction, x, stride ) {
233
+
return sqrt( dvarianceyc( N, correction, x, stride ) );
234
+
}
235
+
236
+
237
+
// EXPORTS //
238
+
239
+
module.exports = dstdevyc;
240
+
</pre></td></tr></table></pre>
241
+
242
+
<divclass='push'></div><!-- for sticky footer -->
243
+
</div><!-- /wrapper -->
244
+
<divclass='footer quiet pad2 space-top1 center small'>
0 commit comments