# Deriving weight formula for exponential moving average

According to this and many other places, weight for exponential moving average is just being defined as $\omega_t=(1-\alpha)\alpha^t$, where $t$ is current index and $\alpha$ is a smoothing factor.

How does one derives this formula itself and what does $\alpha$ mean, and where does one can plug size of averaging window?

This is the problem for me as I expected $\omega$ to be a function of window size $N$ and index $t$, but here and everywhere else I got only $t$ and mysterious $\alpha$.

I understand that $0<\alpha<1$ and that it describes the steepness of the exponential slope, but I am confused that I cant find the derivation of this formula. That is why I cant understand it to the end. Could anybody provide step by step derivation of this?

## 1 Answer

With exponential moving average, your averaging window includes all previous values, although most recent values weight more. A finite w can not thus be defined in this case.

On the other hand, you can select $$\alpha$$ so that the last w samples make up for a given portion of your current estimate.

In your discrete case, an $$\alpha$$ value such that the last w samples make up for about 62.3% of the current estimate would be:

$$\alpha = 1 - e^{(-1/w)}$$

https://en.wikipedia.org/wiki/Exponential_smoothing#Time_Constant