5.9 Exponential Smoothing
NOTE: I don’t know where this section is supposed to go.
Suppose we have an ongoing time series y1,y2,… and we want to make a prediction about yt+1 given the past yt,yt−1,yt−2,…. The exponential smoothing approach takes a value λ∈(0,1) and produces
ˆyt+1=(1−λ)∞∑j=0λjyt−j This forecasted value weights the previous values with the weights decreasing geometricallly as the values go further back in time.
Although the sum is infinite, we can see readily that
ˆyt+1=(1−λ)[yt+λyt−1+λ2yt−2+⋯]=(1−λ)yt+(1−λ)∞∑j=1λjyt−j=(1−λ)yt+λ(1−λ)∞∑j=0λjyt−1−j=(1−λ)yt+λˆyt
So from the infinite sum we can derive a rather simple recursion. Furthermore, this recursion can be re-written as
ˆyt+1=(1−λ)yt+λˆyt−ˆyt+ˆyt=(1−λ)yt−ˆyt(1−λ)+ˆyt=ˆyt+(1−λ)(yt−ˆyt)
Here, the prediction for time t+1 is written as the predicted value for time t plus the deviation of the observed yt and the predicted ˆyt. In this way, the exponential smoother is incorporating new data while giving some weight to the predicted value. It is clear that if λ=1, we stick with our predicted values and if λ=0 we go with the new observed value. For values between 0 and 1 we average between the two.
One way to choose λ is to choose it based on how far back you want values to influence the current prediction. For example, for a “90-day” exponential smooth, we might choose λ such that λj<ε for j>90 and ε very small. For example, for ε=0.00001, we would want λ<0.000011/90≈0.88.
A common stock chart for “technical analysis” is to plot a stock’s observed prices along with various exponential smooths with differing weights. If the current observed price is above one of the smoothed averages it might be considered “over-bought”, while if the observed price is below one of the averages it might be considered “over-sold”. Be forewarned that this is not financial advice!
Here is a plot of the weighted mid price for the SPY exchange traded fund for a few seconds of trading.
Here is the same plot with two exponential smooths, one with λ=0.995 and one with λ=0.999.