Skip to content

weightedStandardDeviation

weightedStandardDeviation(x, weights): number

Defined in: src/weighted_standard_deviation.js:16

The weighted standard deviation is the square root of the weighted variance.

This is a population weighted standard deviation.

number[]

population of one or more data points

number[]

non-negative weights for each data point

number

weighted standard deviation

if x is empty, weights is a different length than x, all weights are zero, or a weight is negative

weightedStandardDeviation([2, 4, 4, 4, 5, 5, 7, 9], [1, 1, 1, 1, 1, 1, 1, 1]); // => 2