Slide 5
Slide 5 text
Welford法
● 平均と分散の漸化式を用いる算出方法、精度良く、負数になることがない
● Knuth本(Art of Computer Programming)で紹介されているらしい
Initialize M1 = x1 and S1 = 0.
For subsequent x‘s, use the recurrence formulas
Mk = Mk-1+ (xk – Mk-1)/k
Sk = Sk-1 + (xk – Mk-1)*(xk – Mk).
For 2 ≤ k ≤ n, the kth estimate of the variance is s2 = Sk/(k – 1).
Accurately computing running variance https://www.johndcook.com/blog/standard_deviation/