Content deleted Content added
→Pseudocode: Note about instability case of Chan algorithm |
→Compensated variant: new section |
||
Line 239:
::Some published code is at http://lib.stat.cmu.edu/apstat/52 , which also indicates its original source. [[User:Melcombe|Melcombe]] ([[User talk:Melcombe|talk]]) 12:13, 27 May 2010 (UTC)
:::Actually I subsequently found that Chan's online-merging algorithm does fine for higher-order moments, but calculates the mean very badly. When A and B have large and comparable size, <math>\bar x_X = \bar x_A + \delta\cdot\frac{n_B}{n_X}</math> for <math>\delta\! = \bar x_B - \bar x_A</math> is not as numerically stable as when one of A and B are very much larger than the other. The error contribution from the subtraction that forms <math>\delta</math> is scaled only by about 1/2, whereas when <math>n_A >> n_B = 1</math> the error contribution from the subtraction is divided by <math>n_A + 1</math>. Instead, prefer to use <math>\bar x_X = \frac{n_A \bar x_A + n_B \bar x_B}{n_A + n_B}</math>. Main page updated accordingly [[User:Markjamesabraham|Markjamesabraham]] ([[User talk:Markjamesabraham|talk]]) 14:54, 30 May 2010 (UTC)
== Compensated variant ==
I cannot make sense of the "compensated" algorithm. It does not appear to be using ordinary Kahan summation.
[[User:Bkalafut|Bkalafut]] ([[User talk:Bkalafut|talk]]) 01:19, 9 July 2010 (UTC)
|