QBUS6840 Lecture 6 Exponential Smoothing (Seasonal)
QBUS6840 Lecture 6
Copyright By PowCoder代写 加微信 powcoder
Exponential Smoothing (Seasonal)
The University of School
Exponential smoothing
Holt-Winters smoothing
Exponential smoothing methods for seasonal data.
Additive seasonality.
Multiplicative seasonality.
Damped Trend Exponential Smoothing
Damped Trend Seasonal
Online Textbook Sections 7.3-7.4 and 7.6:
https://otexts.org/fpp2/expsmooth.html and/or
BOK Sec 8.4-8.5
https://otexts.org/fpp2/expsmooth.html
Objectives
Be able to distinguish between Additive seasonality and
Multiplicative seasonality Exponential smoothing methods for
seasonal data is an Exponential smoothing methods for
seasonal data.
Fully understand the statistical model for exponential
smoothing methods for seasonal data
Be able to use the error correction form to derive forecast and
variance formula
Understand the Damped Trend Exponential Smoothing and
be able to work with its model
Be able to explain Damped Trend Seasonal ES model
Visitor arrivals in Australia
Original series (2006-2015), SES and TCES
Smoothing by SES (black) and TCES (red). They are not suitable
for seasonal data
Holt-Winters smoothing
is an Exponential smoothing methods for seasonal data.
used for both Additive seasonality and Multiplicative
seasonality.
Additive seasonality: the seasonal variation is slowly changing
along the trend as an additive component
Multiplicative seasonality: the seasonal variation is slowly
changing along the trend as a multiplicative component
Introducing Additive Holt-Winters smoothing
The ideal scenario
Yt = ω0 + ω1t + St + εt
Additive decomposition model: assuming ω0, ω1 and St (M
different values) are fixed constants.
Simple exponential method: modelling the case where St = 0,
ω1 = 0 (or constant) and ω0 changes with time. Denoted by
Trend corrected exponential method: modelling the case
where St = 0, both ω1 and ω0 are (slowly) changing
How to model the data if the level, the level growth rate (the
trend), and seasonal patterns are changing?
Additive Holt-Winters smoothing
Suppose the time series {Y1,Y2, …,YT} has an additive
seasonality with seasonal frequency M.
The basic idea of the Holt-Winters method is to use
exponential smoothing for all the levels, trends and seasonal
components.
lt = α(Yt − St−M) + (1− α)(lt−1 + bt−1), 0 ≤ α ≤ 1
bt = β(lt − lt−1) + (1− β)bt−1, 0 ≤ β ≤ 1
St = γ(Yt − lt−1 − bt−1) + (1− γ)St−M , 0 ≤ γ ≤ 1
with the forecast:
Ŷt+1|1:t = lt + bt + St+1−M = lt + bt×1 + St+1−M .
Some people write the seasonal update as
St = γ(Yt − lt) + (1− γ)St−M , 0 ≤ γ ≤ 1
Additive Holt-Winters smoothing
Suppose the time series {Y1,Y2, …,YT} has an additive
seasonality with seasonal frequency M.
The basic idea of the Holt-Winters method is to use
exponential smoothing for all the levels, trends and seasonal
components.
lt = α(Yt − St−M) + (1− α)(lt−1 + bt−1), 0 ≤ α ≤ 1
bt = β(lt − lt−1) + (1− β)bt−1, 0 ≤ β ≤ 1
St = γ(Yt − lt−1 − bt−1) + (1− γ)St−M , 0 ≤ γ ≤ 1
with the forecast:
Ŷt+1|1:t = lt + bt + St+1−M = lt + bt×1 + St+1−M .
Some people write the seasonal update as (not used in our unit)
St = γ(Yt − lt) + (1− γ)St−M , 0 ≤ γ ≤ 1
Explanation
Additive Holt-Winters smoothing
t −M t + 1−M t − 1 t t + 1
Yt − lt−1 − bt−1
St = γ(Yt − lt−1 − bt−1) + (1 − γ)St−MSt
lt = α(Yt − St−M ) + (1 − α)(lt−1 + bt−1)
bt = β(lt − lt−1) + (1 − β)bt−1
Explanation
Additive Holt-Winters smoothing
t −M t + 1−M t − 1 t t + 1
Yt − lt−1 − bt−1
St = γ(Yt − lt−1 − bt−1) + (1 − γ)St−MSt
lt = α(Yt − St−M ) + (1 − α)(lt−1 + bt−1)
bt = β(lt − lt−1) + (1 − β)bt−1
Explanation
Additive Holt-Winters smoothing
t −M t + 1−M t − 1 t t + 1
Yt − lt−1 − bt−1
St = γ(Yt − lt−1 − bt−1) + (1 − γ)St−MSt
lt = α(Yt − St−M ) + (1 − α)(lt−1 + bt−1)
bt = β(lt − lt−1) + (1 − β)bt−1
Explanation
Additive Holt-Winters smoothing
t −M t + 1−M t − 1 t t + 1
Yt − lt−1 − bt−1
St = γ(Yt − lt−1 − bt−1) + (1 − γ)St−MSt
lt = α(Yt − St−M ) + (1 − α)(lt−1 + bt−1)
bt = β(lt − lt−1) + (1 − β)bt−1
Explanation
Additive Holt-Winters smoothing
t −M t + 1−M t − 1 t t + 1
Yt − lt−1 − bt−1
St = γ(Yt − lt−1 − bt−1) + (1 − γ)St−MSt
lt = α(Yt − St−M ) + (1 − α)(lt−1 + bt−1)
bt = β(lt − lt−1) + (1 − β)bt−1
Visitor arrivals in Australia: Lecture06 Example01.py
Additive Holt-Winters method
Visitor arrivals in Australia
Additive Holt-Winters level component estimate
Visitor arrivals in Australia
Additive Holt-Winters seasonal factors
Additive Holt-Winters smoothing
Choice of initial values
How should we set the initial values l0, b0, s0, s−1, . . ., s2−M ,
Suggested Method
1 Do a linear least square regression over the data Y1, . . . ,YT
to find out
Ŷt = ω̂0 + ω̂1t
2 Take l0 = ω̂0 and b0 = ω̂1
3 Find out ŝt = Yt − Ŷt , then take the (seasonal) average of ŝt
as one of s0, s−1, . . ., s2−M , s1−M according to each season.
Additive Holt-Winters smoothing
Choice of initial values
How should we set the initial values l0, b0, s0, s−1, . . ., s2−M ,
Suggested Method
1 Do a linear least square regression over the data Y1, . . . ,YT
to find out
Ŷt = ω̂0 + ω̂1t
2 Take l0 = ω̂0 and b0 = ω̂1
3 Find out ŝt = Yt − Ŷt , then take the (seasonal) average of ŝt
as one of s0, s−1, . . ., s2−M , s1−M according to each season.
Additive Holt-Winters smoothing
Some notes
Useful when level and/or trend and seasonal variation is not
changing much
Choice of initial seasonal indices can be important.
Visitor arrivals in Australia
Additive Holt-Winters forecast
Visitor arrivals in Australia
Additive Holt-Winters forecast
Visitor arrivals in Australia
Additive Holt-Winters fit
Visitor arrivals in Australia
Additive Holt-Winters residuals
Visitor arrivals in Australia
Additive Holt-Winters residual autocorrelations
We will talk about this in Week 7
Alcohol related assaults in NSW
Additive Holt-Winters fit
Additive Holt-Winters smoothing
lt = α(Yt − St−M) + (1− α)(lt−1 + bt−1),
bt = β(lt − lt−1) + (1− β)bt−1,
St = γ(Yt − lt−1 − bt−1) + (1− γ)St−M ,
Yt+1 = lt + bt + St+1−M + εt+1, εt+1 ∼ N(0, σ2).
We can chose the parameters α, β and γ by minimising
(Yt − lt−1 − bt−1 − St−M)2
Additive Holt-Winters smoothing
Error correction formulation for level
lt = α(Yt − St−M) + (1− α)(lt−1 + bt−1)
= lt−1 + bt−1 + α(Yt − lt−1 − bt−1 − St−M)
= lt−1 + bt−1 + αεt
Additive Holt-Winters smoothing
Error correction formulation for trend
bt = β(lt − lt−1) + (1− β)bt−1
= bt−1 + β(lt − lt−1 − bt−1)
= bt−1 + βαεt
The second equation comes from the error form of lt on the
previous slide.
Additive Holt-Winters smoothing
Error correction formulation for seasonality
St = γ(Yt − lt−1 − bt−1) + (1− γ)St−M
= St−M + γ(Yt − lt−1 − bt−1 − St−M)
= St−M + γεt
The second equation comes from the error form of Yt in the model
definition.
Additive Holt-Winters smoothing
Error correction formulation
lt = lt−1 + bt−1 + αεt
bt = bt−1 + αβεt
St = St−M + γεt
Yt = lt−1 + bt−1 + St−M + εt
e.g . Yt+1 = lt + bt + St+1−M + εt+1
= (lt−1 + bt−1 + αεt) + (bt−1 + αβεt) + St−M+1 + εt+1
= lt−1 + 2bt−1 + St−M+1 + α(1 + β)εt + εt+1
Additive Holt-Winters smoothing
Forecasting equations
Ŷt+1|1:t = E(lt + bt + St−M+1 + εt+1|Y1:t)
= lt + bt + St−M+1
(= lt−1 + 2bt−1 + St−M+1 + α(1 + β)εt)
We cannot get rid of the last term with εt . Why?
Ŷt+2|1:t = E(lt+1 + bt+1 + St−M+2 + εt+2|Y1:t)
= E(lt + 2bt + St−M+2 + α(1 + β)εt+1 + εt+2|Y1:t)
= lt + 2bt + St−M+2
Ŷt+h|1:t = lt + hbt + St−M+(h mod M) Or
Ŷt+h|1:t = lt + hbt + St+h−M(k+1)
where k is the integer part of (h − 1)/M.
Additive Holt-Winters smoothing
Variance for interval forecasts
Yt+1 =lt + bt + St+1−M + εt+1
=lt−1 + 2bt−1 + St−M+1 + α(1 + β)εt + εt+1
V(Yt+1|Y1:t) = V(lt + bt + St−M+1 + εt+1|Y1:t)
V(Yt+2|Y1:t) = V(lt+1 + bt+1 + St−M+2 + εt+2|Y1:t)
= V(lt + 2bt + St−M+2 + α(1 + β)εt+1 + εt+2|Y1:t)
= σ2(1 + α2(1 + β)2)
Additive Holt-Winters smoothing
Variance for interval forecasts
Yt+1 =lt + bt + St+1−M + εt+1
=lt−1 + 2bt−1 + St−M+1 + α(1 + β)εt + εt+1
V(Yt+3|Y1:t) = V(lt+2 + bt+2 + St−M+3 + εt+3|Y1:t)
= V(lt+1 + 2bt+1 + St−M+3 + α(1 + β)εt+2 + εt+3|Y1:t)
= V(lt + 3bt + St−M+3 + α(1 + 2β)εt+1 + α(1 + β)εt+2 + εt+3)
= σ2(1 + α2(1 + β)2 + α2(1 + 2β)2)
V(Yt+h|Y1:t) = V
lt + hbt + St−M+h + α
(1 + (h − i)β)εt+i + εt+h|Y1:t
(1 + (h − i)β)2
, for h ≤ M only.
Additive Holt-Winters smoothing (optional)
Variance for interval forecasts
For h > M,
V(Yt+h|Y1:t) = V
lt + hbt + St−M+h + α
(1 + (h − i)β)εt+i + εt+h|Y1:t
lt + hbt + St−2M+h + γεt−M+h
(1 + (h − i)β)εt+i + εt+h|Y1:t
[α(1 + iβ) + Ii,Mγ]
where Ii,M = 1 if i is an integer multiple of M and 0 otherwise.
Additive Holt-Winters smoothing
Forecasting: collecting the results
Ŷt+h|1:t = lt + hbt + St−M+(h mod M).
V(Yt+h|Y1:t) = σ2
[α(1 + iβ) + Ii ,Mγ]
Alcohol related assaults in NSW
Additive Holt-Winters forecast
Alcohol related assaults in NSW
Additive Holt-Winters forecast
Multiplicative Holt-Winters smoothing
Most useful when the seasonal pattern changes in a strong
pattern and is proportional to the level of the series.
Multiplicative Holt-Winters smoothing
lt = α(Yt/St−M) + (1− α)(lt−1 + bt−1),
bt = β(lt − lt−1) + (1− β)bt−1,
St = γ(Yt/(lt−1 + bt−1)) + (1− γ)St−M ,
Yt+1 = (lt + bt)× St+1−M + εt+1, εt+1 ∼ N(0, σ2).
We can chose the parameters α, β and γ by minimising
(Yt − (lt−1 + bt−1)St−M)2
Multiplicative Holt-Winters smoothing
Error correction formulation for level
lt = α(Yt/St−M) + (1− α)(lt−1 + bt−1)
= lt−1 + bt−1 + α(Yt/St−M − lt−1 − bt−1)
= lt−1 + bt−1 + α
Yt − (lt−1+bt−1)St−M
= lt−1 + bt−1 + α
Multiplicative Holt-Winters smoothing
Error correction formulation for trend
bt = β(lt − lt−1) + (1− β)bt−1
= bt−1 + βα
Yt − (lt−1 + bt−1)St−M
see previous slide
= bt−1 + αβ
Multiplicative Holt-Winters smoothing
Error correction formulation for seasonality
St = γ(Yt/(lt−1 + bt−1)) + (1− γ)St−M
= St−M + γ
Yt − (lt−1 + bt−1)St−M
lt−1 + bt−1
= St−M + γ
lt−1 + bt−1
Multiplicative Holt-Winters smoothing
Error correction formulation
lt = lt−1 + bt−1 + α
bt = bt−1 + αβ
St = St−M + γ
lt−1 + bt−1
Yt = (lt−1 + bt−1)× St−M + εt
Multiplicative Holt-Winters smoothing
Forecasting equations
Ŷt+1|1:t = E((lt + bt)St−M+1 + εt+1|Y1:t)
= (lt + bt)St−M+1
Ŷt+2|1:t = E((lt+1 + bt+1)St−M+2 + εt+2|Y1:t)
lt + 2bt + α(1 + β)
St−M+2 + εt+2
= (lt + 2bt)St−M+2
Ŷt+h|1:t = (lt + hbt)St−M+h (h ≤ M)
For h > M, the formula is too complicated. We omit it!
Multiplicative Holt-Winters smoothing
Variance for interval forecasts
lt−1 + 2bt−1 + α(1 + β)
St−M+1 + εt+1
V(Yt+1|Y1:t) = V((lt + bt)St−M+1 + εt+1|Y1:t)
V(Yt+2|Y1:t) = V((lt+1 + bt+1)St−M+2 + εt+2|Y1:t)
lt + 2bt + α(1 + β)
St−M+2 + εt+2|Y1:t
= σ2(1 + α2(1 + β)2(S2t−M+2/S
Multiplicative Holt-Winters smoothing
Forecasting formula
Ŷt+h|1:t = (lt + hbt)× St+h−M .
where h ≤ M.
Dampened trend ES
Extrapolating trends indefinitely into the future can be problematic.
Dampened trend exponential smoothing aims to deal with this
Dampened trend ES
Illustration
Dampened trend ES
lt = αYt + (1− α)(lt−1 + φbt−1),
bt = β(lt − lt−1) + (1− β)φbt−1,
Yt+1 = lt + φbt + εt+1,
where φ is the dampening factor, with 0 ≤ φ ≤ 1.
Dampened trend ES
Forecasting and variance equations
Yt+1 = lt + φbt + εt+1
Ŷt+1|1:t = lt + φbt
V(Yt+1|Y1:t) = σ2
Dampened trend ES
Forecasting and variance equations
Yt+2 = lt+1 + φbt+1 + εt+2
= lt + φbt + φ
2bt + α(1 + φβ)εt+1 + εt+2
Ŷt+2|1:t = lt + bt(φ+ φ
V(Yt+2|Y1:t) = σ2(1 + α2(1 + φβ)2)
Dampened trend ES
Forecasting formula
Ŷt+h|1:t = lt + φbt + φ
3bt + . . .+ φ
Compared with the forecast of the trend correct exponential
Ŷt+h|1:t = lt + h × bt
What happens as h gets larger?
For the dampened forecast Ŷt+h|1:t → lt +
For the trend corrected forecast
Ŷt+h|1:t →∞
Dampened trend ES
Forecasting formula
Ŷt+h|1:t = lt + φbt + φ
3bt + . . .+ φ
Compared with the forecast of the trend correct exponential
Ŷt+h|1:t = lt + h × bt
What happens as h gets larger?
For the dampened forecast Ŷt+h|1:t → lt +
For the trend corrected forecast
Ŷt+h|1:t →∞
Dampened trend seasonal
lt = α(Yt − St−M) + (1− α)(lt−1 + φbt−1),
bt = β(lt − lt−1) + (1− β)φbt−1,
St = γ(Yt − lt) + (1− γ)St−M ,
(or St = γ(Yt − lt−1 − φbt−1) + (1− γ)St−M , )
Yt+1 = lt + φbt + St−M+1 + εt+1,
where φ is the dampening factor, with 0 ≤ φ ≤ 1.
Dampened trend seasonal
Forecasting formula
Ŷt+h|1:t = lt + φbt + φ
3bt + . . .+ φ
hbt + St+h−M
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com