Loading [MathJax]/jax/output/HTML-CSS/jax.js

Wednesday, June 1, 2011

On MapReduce application for online exponential rates summarizer.

as a follow-up to Ted Dunning's post exponentially weighted averaging:

Here's the bottom line result from that post:

π=e(tntn1)/αsn=πsn1+xwn=πwn1+(ttn)tn=t

Some additions are due:

Combiner routine:
In most general case, when both summarizers have non-zero history, and t1>t2 ,

π=e(t1t2)/α,w=max(w1,πw2),s=s1+πs2.

Case t1<t2 is symmetrical w.r.t. indices ()1,()2 .

This combiner routine however is not consistent with original formula as time spans are not exponentially compressed into time scale. Therefore, unit test for such combiner produces significant errors in various history combinations.

A combine-consistent routine:
A better formulation that works fine with the combiner is as follows:

Case tn+1>tn :

{Δt=tn+1tn,{π0=1,πn+1=eΔt/α;wn+1=πn+1wn+α(1πn+1);sn+1=xn+1+πn+1sn;tn+1=tn+1.

The term α(1πn+1)  really corresponds to the function average of the exponent function f(x)=ex multiplied by Δt  as in
Δtˉf(x|[Δtα,0])=ΔtαΔt0Δt/αexdx==α(e0eΔt/α)==α(1π).

Finally, update-in-the-past also looks different for consistency and combining sake:


Case tn+1<tn:

{Δt=tntn+1,{π0=1,π=eΔt/α,wn+1=max[wn,α(1πn+1)],sn+1=sn+πn+1xn+1,tn+1=tn.(nochange)

No comments:

Post a Comment