How is the recursive function in exponential smoothing evaluated

bayesianexponential-smoothingtime series

In exponential smoothing models, the most recent observation is weighted most heavily, while observations further back receive a smaller and smaller portion of weight. An alpha parameter will inform the exponential decay of weights going back in time.

f[i] = ax[i]
       + a(1-a)(x[i-1])
       + a(1-a)(1-a)(x[i-2])
       + ...

Source

The infinite series of weights will sum to 1. But in practice, how is this evaluated? I can see three possible options:

  1. Have some arbitrary depth cutoff; after x iterations, whether the weight is 0.1 or 0.0001, terminate evaluation.
  2. Have some arbitrary weight cutoff; whenever the weight value is less than 0.001 terminate, whether depth is 10 or 100.
  3. Use sequence/series trick from calculus to reframe the series as a constant that can be solved for.

Of note, I'm particularly interested in Bayesian approach to exponential smoothing, so any insights into how MCMC would solve parameter estimation in exponential smoothing would be of interest to me.

Best Answer

This is nicely explained in Forecasting: Principles and Practice by Rob J Hyndman and George Athanasopoulos:

The process has to start somewhere, so we let the first fitted value at time 1 be denoted by $\ell_0$ (which we will have to estimate). Then

$$ \begin{align*} \hat{y}_{2|1} &= \alpha y_1 + (1-\alpha) \ell_0\\ \hat{y}_{3|2} &= \alpha y_2 + (1-\alpha) \hat{y}_{2|1}\\ \hat{y}_{4|3} &= \alpha y_3 + (1-\alpha) \hat{y}_{3|2}\\ \vdots\\ \hat{y}_{T|T-1} &= \alpha y_{T-1} + (1-\alpha) \hat{y}_{T-1|T-2}\\ \hat{y}_{T+1|T} &= \alpha y_T + (1-\alpha) \hat{y}_{T|T-1}. \end{align*} $$

Substituting each equation into the following equation, we obtain

$$ \begin{align*} \hat{y}_{3|2} & = \alpha y_2 + (1-\alpha) \left[\alpha y_1 + (1-\alpha) \ell_0\right] \\ & = \alpha y_2 + \alpha(1-\alpha) y_1 + (1-\alpha)^2 \ell_0 \\ \hat{y}_{4|3} & = \alpha y_3 + (1-\alpha) [\alpha y_2 + \alpha(1-\alpha) y_1 + (1-\alpha)^2 \ell_0]\\ & = \alpha y_3 + \alpha(1-\alpha) y_2 + \alpha(1-\alpha)^2 y_1 + (1-\alpha)^3 \ell_0 \\ & ~~\vdots \\ \hat{y}_{T+1|T} & = \sum_{j=0}^{T-1} \alpha(1-\alpha)^j y_{T-j} + (1-\alpha)^T \ell_{0}. \end{align*} $$

So you would be usually calculating it sequentially, starting from the time 1.

Related Question