Exponential Smoothing¶
Context¶
Given a time series data \(x_t\) beginning at time \(t = 0\), we want to use a window function to smooth \(x_t\) where the recent samples are assigned with a larger weighting and the older samples are assigned with a smaller weighting.
Problem¶
How to design such a window that is easy to compute?
Solution¶
Basic exponential smoothing¶
Use a exponential windows function where the smoothed output \(s_t\) is computed by the formulas:
where \(\alpha\) is the smoothing factor, and \(0 < \alpha < 1\).
\(s_t\) can be also written as
This is also known as an "exponentially weighted moving average (EWMA)."
Convergence Analysis¶
Let \(x_t\) be a step function of magnitude \(A\) where
Then \(s_t\) will be
So the time for \(s_t\) to converge to \(s_t = qA\) for some \(0 < q < 1\) is
And by choosing \(q = 1 - \frac{1}{e}\), we can obtain the time constant \(\tau\) for the basic exponential smoothing:
Biased Toward \(x_0\)¶
To improve stability, \(\alpha\) is usually set to a smaller number (like 0.05). This makes the weighting of \(x_0\) significantly larger than the rest of \(x_t\) when \(t\) is small, for all \(x_t\) except \(x_0\) are scaled by \(\alpha\).