Professional Documents
Culture Documents
Business Forecasting
ECON 6635/ECON 3343
Dr. Esin Cakan
OTexts.org/fpp3/
Outline
1 Complex seasonality
2 Vector autoregression
2
Examples
3
Examples
400
300
200
100
0
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33
Weeks
400
Call volume
300
200
100
1 2 3 4
Weeks
4
Examples
25
Electricity Demand (GW)
20
15
10
5
TBATS model
TBATS
Trigonometric terms for seasonality
Box-Cox transformations for heterogeneity
ARMA errors for short-term dynamics
Trend (possibly damped)
Seasonal (including multiple and
non-integer periods)
6
TBATS model
yt = observation at time t
(y ω− 1)/ω if ω =6 0;
t
yt(ω) =
log yt if ω = 0.
M
yt(ω) = `t−1 + φbt−1 + (i)
X
st−mi + dt
i=1
`t = `t−1 + φbt−1 + αdt
bt = (1 − φ)b + φbt−1 + βdt
p
X q
X
dt = φi dt−i + θj εt−j + εt
i=1 j=1
ki s(i)
j,t =
(i)
sj,t−1 cos λj(i) + s∗(i) (i) (i)
j,t−1 sin λj + γ1 dt
s(i) s(i)
X
t = j,t ∗(i)
j=1 s(i) (i) (i) (i) (i)
j,t = −sj,t−1 sin λj + sj,t−1 cos λj + γ2 dt
7
TBATS model
yt = observation at time t
(y ω− 1)/ω
t if ω =6 0; Box-Cox transformation
yt(ω) =
log yt if ω = 0.
M
yt(ω) = `t−1 + φbt−1 + (i)
X
st−mi + dt
i=1
`t = `t−1 + φbt−1 + αdt
bt = (1 − φ)b + φbt−1 + βdt
p
X q
X
dt = φi dt−i + θj εt−j + εt
i=1 j=1
ki s(i)
j,t =
(i)
sj,t−1 cos λj(i) + s∗(i) (i) (i)
j,t−1 sin λj + γ1 dt
s(i) s(i)
X
t = j,t ∗(i)
j=1 s(i) (i) (i) (i) (i)
j,t = −sj,t−1 sin λj + sj,t−1 cos λj + γ2 dt
7
TBATS model
yt = observation at time t
(y ω− 1)/ω
t if ω =6 0; Box-Cox transformation
yt(ω) =
log yt if ω = 0.
M
yt(ω) = `t−1 + φbt−1 + (i)
st−mi + dt M seasonal periods
X
i=1
`t = `t−1 + φbt−1 + αdt
bt = (1 − φ)b + φbt−1 + βdt
p
X q
X
dt = φi dt−i + θj εt−j + εt
i=1 j=1
ki s(i)
j,t =
(i)
sj,t−1 cos λj(i) + s∗(i) (i) (i)
j,t−1 sin λj + γ1 dt
s(i) s(i)
X
t = j,t ∗(i)
j=1 s(i) (i) (i) (i) (i)
j,t = −sj,t−1 sin λj + sj,t−1 cos λj + γ2 dt
7
TBATS model
yt = observation at time t
(y ω− 1)/ω
t if ω =6 0; Box-Cox transformation
yt(ω) =
log yt if ω = 0.
M
yt(ω) = `t−1 + φbt−1 + (i)
st−mi + dt M seasonal periods
X
i=1
`t = `t−1 + φbt−1 + αdt global and local trend
bt = (1 − φ)b + φbt−1 + βdt
p
X q
X
dt = φi dt−i + θj εt−j + εt
i=1 j=1
ki s(i)
j,t =
(i)
sj,t−1 cos λj(i) + s∗(i) (i) (i)
j,t−1 sin λj + γ1 dt
s(i) s(i)
X
t = j,t ∗(i)
j=1 s(i) (i) (i) (i) (i)
j,t = −sj,t−1 sin λj + sj,t−1 cos λj + γ2 dt
7
TBATS model
yt = observation at time t
(y ω− 1)/ω
t if ω =6 0; Box-Cox transformation
yt(ω) =
log yt if ω = 0.
M
yt(ω) = `t−1 + φbt−1 + (i)
st−mi + dt M seasonal periods
X
i=1
`t = `t−1 + φbt−1 + αdt global and local trend
bt = (1 − φ)b + φbt−1 + βdt
p q
X X ARMA error
dt = φi dt−i + θj εt−j + εt
i=1 j=1
ki s(i)
j,t =
(i)
sj,t−1 cos λj(i) + s∗(i) (i) (i)
j,t−1 sin λj + γ1 dt
s(i) s(i)
X
t = j,t ∗(i)
j=1 s(i) (i) (i) (i) (i)
j,t = −sj,t−1 sin λj + sj,t−1 cos λj + γ2 dt
7
TBATS model
yt = observation at time t
(y ω− 1)/ω
t if ω =6 0; Box-Cox transformation
yt(ω) =
log yt if ω = 0.
M
yt(ω) = `t−1 + φbt−1 + (i)
st−mi + dt M seasonal periods
X
i=1
`t = `t−1 + φbt−1 + αdt global and local trend
bt = (1 − φ)b + φbt−1 + βdt
p q
X X ARMA error
dt = φi dt−i + θj εt−j + εt
i=1 j=1
ki s(i)
j,t =
(i)
sj,t−1 λj(i) + s∗(i)
cosFourier-like sin λ(i)
j,t−1 seasonal
(i)
j + γterms
1 dt
s(i) s(i)
X
t = j,t ∗(i)
j=1 s(i) (i) (i) (i) (i)
j,t = −sj,t−1 sin λj + sj,t−1 cos λj + γ2 dt
7
TBATS model
yt = observation at time t
(y ω− 1)/ω
t if ω =6 0; Box-Cox transformation
yt(ω) =
TBATS
log yt if ω = 0.
Trigonometric M
M seasonal periods
yt(ω) = `t−1 + φbt−1 + (i)
X
st−m + dt
Box-Cox i=1 i
level
80
.
8
95
600
level
400 80
.
95
200
0 10 20 30
Time
9
Complex seasonality
25
level
20
80
.
95
15
10
TBATS
Trigonometric terms for seasonality
Box-Cox transformations for heterogeneity
ARMA errors for short-term dynamics
Trend (possibly damped)
Seasonal (including multiple and non-integer periods)
Handles non-integer seasonality, multiple seasonal
periods.
Entirely automated
Prediction intervals often too wide
11
Very slow on long series
Outline
1 Complex seasonality
2 Vector autoregression
12
Outline
1 Complex seasonality
2 Vector autoregression
13
Neural network models
14
Neural network models
15
Neural network models
16
Neural network models
17
NNAR models
20
NNAR(9,5) model for sunspots
fit <- nnetar(sunspotarea)
fit %>% forecast(h=20) %>% autoplot()
Forecasts from NNAR(9,5)
3000
2000
sunspotarea
1000
2000
sunspotarea
level
80
95
1000
1 Complex seasonality
2 Vector autoregression
23