Adding/Combining Standard Deviations

可紊 提交于 2019-12-03 21:37:05

Yes, you can combine them. You need to know the number of observations, mean, and standard deviation for each day. The variance is easier to work with than the standard deviation, so I'll express everything else in terms of variance. (Standard deviation is defined as the square root of the variance.)

Denote:

n[i] # observations for day i
m[i] # mean for day i
v[i] # variance for day i

You'll need to calculate the total number of observations N and the overall mean M. This is easy:

days = [day1, day2, ..., day_final]
N = sum(n[i] for i in days)
M = sum(n[i] * m[i] for i in days) / N

The overall variance V is more complicated, but still can be calculated:

s1 = sum(n[i] * v[i] for i in days)
s2 = sum(n[i] * (m[i] - M)**2 for i in days)
V = (s1 + s2) / N

The above are for the population variance. If you instead have v[i] as the sample variance, some minor modifications to s1 and V are needed:

s1_sample = sum((n[i] - 1) * v[i] for i in days)
V_sample = (s1_sample + s2) / (N - 1)

No, you can't add standard deviations.

Prove it to yourself with the numbers you provided:

X = 2.645751311, Y = 13.72345923

Standard deviation of combined set: 11.48912529

You can do a more general proof using the formula for standard deviation. You need the covariance of the two - scroll down to "identities":

http://en.wikipedia.org/wiki/Standard_deviation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!