English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Basically i need to calculate the standard deviation of sample values as they are recieved, but without having to save all previous sample values. eg if i all the info i have is the number of values (n) and the mean of those values (m) and the standard deviation for those values (sd) is it possible to recalculate the standard deviation when given an extra sample value?

2007-02-14 22:26:25 · 1 answers · asked by Anonymous in Science & Mathematics Mathematics

1 answers

Yes, that is possible. Remember that variance is given by the formula σ²=∑(x²)/n - μ², where the sum is taken over all sample values x. So, knowing the standard deviation and the mean, you may recover the current ∑(x²) using ∑(x²) = n(σ²+μ²). Similarly, you may recover ∑x using ∑x=nμ. Then, given a new value (which we'll call X), you may compute new values as follows:

n' = n+1
(∑x)' = ∑x + X
(∑(x²))' = ∑(x²) + X²
μ'=(∑x)'/n'
σ'²=(∑(x²))'/n' - μ'²
σ'=√(σ'²)

Incidentally, if you need to calculate these totals as new values are received, it may be simpler to keep track of n, ∑x, and ∑(x²), rather than n, μ, and σ.

2007-02-15 02:43:14 · answer #1 · answered by Pascal 7 · 0 0

fedest.com, questions and answers