Skip to content

combineVariances

combineVariances(variance1, mean1, n1, variance2, mean2, n2): number

Defined in: src/combine_variances.js:22

When combining two lists of values for which one already knows the variances, one does not have to necessary recompute the variance of the combined lists in linear time. They can instead use this function to compute the combined variance by providing the variance, mean & number of values of the first list and the variance, mean & number of values of the second list.

number

variance of the first list

number

mean of the first list

number

number of items in the first list

number

variance of the second list

number

mean of the second list

number

number of items in the second list

number

the combined mean

3.0.0

combineVariances(14 / 3, 5, 3, 8 / 3, 4, 3); // => 47 / 12