Tools
aa998.txt
Associated article: Discontiguous Exponential Averaging
Tags: Tools
Published source code accompanying the column by John C. Gunther in which he examines how common approaches to exponentially decaying averages are fundamentally flawed. John takes a close look at this standard technique and shows how to mend it.
Algorithm Alley
by John C. Gunther
Listing One
ewInitialize(ew, alpha, firstData) {
assert(0 <= alpha < 1)
ew.alpha = alpha
ew.average = firstData
}
ewUpdate(ew, newData) {
ew.average = ew.alpha*ew.average + (1-ew.alpha)*newData
}
Listing Two
ewInitialize(ew, alpha) {
assert(0 &...


