@technobuddha/library
Version:
A large library of useful functions
17 lines (14 loc) • 565 B
text/typescript
import variance from '../variance';
/**
* Returns the sample standard deviation of the arguments. For a definition of
* sample standard deviation, see http://en.wikipedia.org/wiki/Standard_deviation
*
* @param datapoints samples to analyze.
* @return The sample standard deviation of the arguments (0 if fewer
* than two samples were provided, or NaN if any of the samples is
* not a valid number).
*/
export function standardDeviation(...datapoints: number[]): number {
return Math.sqrt(variance(...datapoints));
}
export default standardDeviation;