I am looking for a function to calculate exponential moving sum in numpy or scipy. I want to avoid using python loops because they are really slow.
to be specific, I have two series A[] and T[]. T[i] is the timestamp of value A[i]. I define a half-decay period tau. For a given time t, the exponential moving sum is the sum of all the values A[i] that happens before t, with weight exp(-(t-T[i])/tau) for each A[i].
Thanks a lot!
Take a look at numpy.convolve. The exponential moving sum is a convolution.