@stdlib/stats-array
v0.1.1
Published
Statistical functions for arrays.
Readme
Statistics
Statistical functions for arrays.
Installation
npm install @stdlib/stats-arrayUsage
var ns = require( '@stdlib/stats-array' );ns
Namespace containing APIs for performing statistical operations on arrays.
var o = ns;
// returns {...}The namespace exports the following:
maxBy( x, clbk[, thisArg] ): calculate the maximum value of an array via a callback function.max( x ): calculate the maximum value of an array.maxabs( x ): calculate the maximum absolute value of an array.maxsorted( x ): calculate the maximum value of a sorted array.mean( x ): calculate the arithmetic mean of an array.meankbn( x ): calculate the arithmetic mean of an array using an improved Kahan–Babuška algorithm.meankbn2( x ): calculate the arithmetic mean of an array using a second-order iterative Kahan–Babuška algorithm.meanors( x ): calculate the arithmetic mean of an array using ordinary recursive summation.meanpn( x ): calculate the arithmetic mean of an array using a two-pass error correction algorithm.meanpw( x ): calculate the arithmetic mean of an array using pairwise summation.meanwd( x ): calculate the arithmetic mean of an array using Welford's algorithm.mediansorted( x ): calculate the median value of a sorted array.minBy( x, clbk[, thisArg] ): calculate the minimum value of an array via a callback function.min( x ): calculate the minimum value of an array.minabs( x ): calculate the minimum absolute value of an array.minsorted( x ): calculate the minimum value of a sorted array.mskmax( x, mask ): calculate the maximum value of an array according to a mask.mskmin( x, mask ): calculate the minimum value of an array according to a mask.mskrange( x, mask ): calculate the range of an array according to a mask.nanmaxBy( x, clbk[, thisArg] ): calculate the maximum value of an array via a callback function, ignoringNaNvalues.nanmax( x ): calculate the maximum value of an array, ignoringNaNvalues.nanmaxabs( x ): calculate the maximum absolute value of an array, ignoringNaNvalues.nanmean( x ): calculate the arithmetic mean of an array, ignoringNaNvalues.nanmeanors( x ): calculate the arithmetic mean of an array, ignoringNaNvalues and using ordinary recursive summation.nanmeanpn( x ): calculate the arithmetic mean of an array, ignoringNaNvalues and using a two-pass error correction algorithm.nanmeanwd( x ): calculate the arithmetic mean of an array, ignoringNaNvalues and using Welford's algorithm.nanminBy( x, clbk[, thisArg] ): calculate the minimum value of an array via a callback function, ignoringNaNvalues.nanmin( x ): calculate the minimum value of an array, ignoringNaNvalues.nanminabs( x ): calculate the minimum absolute value of an array, ignoringNaNvalues.nanmskmax( x, mask ): calculate the maximum value of an array according to a mask, ignoringNaNvalues.nanmskmin( x, mask ): calculate the minimum value of an array according to a mask, ignoringNaNvalues.nanmskrange( x, mask ): calculate the range of an array according to a mask, ignoringNaNvalues.nanrangeBy( x, clbk[, thisArg] ): calculate the range of an array via a callback function, ignoringNaNvalues.nanrange( x ): calculate the range of an array, ignoringNaNvalues.nanstdev( x[, correction] ): calculate the standard deviation of an array ignoringNaNvalues.nanstdevch( x[, correction] ): calculate the standard deviation of an array ignoringNaNvalues and using a one-pass trial mean algorithm.nanstdevpn( x[, correction] ): calculate the standard deviation of an array ignoringNaNvalues and using a two-pass algorithm.nanstdevtk( x[, correction] ): calculate the standard deviation of an array ignoringNaNvalues and using a one-pass textbook algorithm.nanstdevwd( x[, correction] ): calculate the standard deviation of an array ignoringNaNvalues and using Welford's algorithm.nanstdevyc( x[, correction] ): calculate the standard deviation of an array ignoringNaNvalues and using a one-pass algorithm proposed by Youngs and Cramer.nanvariance( x[, correction] ): calculate the variance of an array ignoringNaNvalues.nanvariancech( x[, correction] ): calculate the variance of an array ignoringNaNvalues and using a one-pass trial mean algorithm.nanvariancepn( x[, correction] ): calculate the variance of an array ignoringNaNvalues and using a two-pass algorithm.nanvariancetk( x[, correction] ): calculate the variance of an array ignoringNaNvalues and using a one-pass textbook algorithm.nanvariancewd( x[, correction] ): calculate the variance of an array ignoringNaNvalues and using Welford's algorithm.nanvarianceyc( x[, correction] ): calculate the variance of an array ignoringNaNvalues and using a one-pass algorithm proposed by Youngs and Cramer.rangeBy( x, clbk[, thisArg] ): calculate the range of an array via a callback function.range( x ): calculate the range of an array.stdev( x[, correction] ): calculate the standard deviation of an array.stdevch( x[, correction] ): calculate the standard deviation of an array using a one-pass trial mean algorithm.stdevpn( x[, correction] ): calculate the standard deviation of an array using a two-pass algorithm.stdevtk( x[, correction] ): calculate the standard deviation of an array using a one-pass textbook algorithm.stdevwd( x[, correction] ): calculate the standard deviation of an array using Welford's algorithm.stdevyc( x[, correction] ): calculate the standard deviation of an array using a one-pass algorithm proposed by Youngs and Cramer.variance( x[, correction] ): calculate the variance of an array.variancech( x[, correction] ): calculate the variance of an array using a one-pass trial mean algorithm.variancepn( x[, correction] ): calculate the variance of an array using a two-pass algorithm.variancetk( x[, correction] ): calculate the variance of an array using a one-pass textbook algorithm.variancewd( x[, correction] ): calculate the variance of an array using Welford's algorithm.varianceyc( x[, correction] ): calculate the variance of an array using a one-pass algorithm proposed by Youngs and Cramer.
Examples
var objectKeys = require( '@stdlib/utils-keys' );
var ns = require( '@stdlib/stats-array' );
console.log( objectKeys( ns ) );Notice
This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.
Community
License
See LICENSE.
Copyright
Copyright © 2016-2026. The Stdlib Authors.
