STA457 Week 7 Notes
STA457 Week 7 Notes
Lecture 11
Lijia Wang
Last Time:
1 Forecasting
2 Estimation
Today:
1 Integrated ARMA (ARIMA) models
2 Building ARIMA models
µt = µt→1 + εt ,
→xt = εt + →yt ,
is stationary.
→d xt = (1 ↑ B)d xt
where ϱ = µ(1 ↑ ϑ1 ↑ ϑ2 ↑ · · · ↑ ϑp ).
n
For example, if d = 1, given forecasts yn+m for m = 1, 2, . . ., we have
n
yn+m n
= xn+m n
↑ xn+m→1 , so that
n n n
xn+m = yn+m + xn+m→1
n
with initial condition xn+1 n
= yn+1 + xn .
xt = xt→1 + wt ↑ ςwt→1 ,
with |ς| < 1, for t = 1, 2, . . ., and x0 = 0. We could also include a drift
term in the formula.
If we write
yt = wt ↑ ςwt→1 ,
we may write the IMA(1,1) as ! xt = xt→1 + yt . Because |ς| < 1, yt has an
invertible representation, yt = ↑j=1 ς jy
t→j + wt , and substituting
yt = xt ↑ xt→1 , we may write
↑
"
xt = (1 ↑ ς)ςj→1 xt→j + wt .
j=1
There are a few basic steps to fitting ARIMA models to time series data.
These steps involve:
1 Plotting the data and interpreting the plot.
2 Possibly transforming the data (e.g., log, first di!erence).
3 Identifying the dependence orders of the model (p, d, q).
4 Parameter estimation.
5 Diagnostics of residuals (interpretation, normality assumptions, ACF
graphs).
6 Model choice.
xt ↑ x̂tt→1
et = # ,
P̂tt→1
When reports of GNP and similar economic indicators are given, it is often
in growth rate (percent change) rather than in actual (or adjusted) values
that is of interest. The growth rate, say, xt = →log(yt ), is plotted, and it
appears to be a stable process.
Figure: Sample ACF and PACF of the GNP quarterly growth rate
Inspecting the sample ACF and PACF, we might feel that two models are
suitable for the data:
1 The ACF is cutting o! at lag 2 and the PACF is tailing o!. This
would suggest the GNP growth rate follows an MA(2) process, or log
GNP follows an ARIMA(0,1,2) model.
2 The ACF is tailing o! and the PACF is cutting o! at lag 1. This
suggests an AR(1) model for the growth rate, or ARIMA(1,1,0) for
log GNP.
Rather than focus on one model, we will fit both models.
The figure shows the p-values associated with the Ljung-Box Q-statistic,
at lags H = 3 through H = 20 (with corresponding degrees of freedom
H ↑ 2).
Lijia Wang
Last Time:
1 Integrated ARMA (ARIMA) models
2 Building ARIMA models
Today:
1 Regression with Auto-correlated Errors
2 Multiplicative Seasonal ARIMA Models
ϑ(B)xt = wt
Mt = ω1 + ω2 t + ω3 Tr + ω4 Tr2 + ω5 Pt + xt
Figure: Sample ACF and PACF of the mortality residuals indicating an AR(2)
process.
Lijia Wang (UofT) STA457: Time Series Analysis 8 / 19
Fit the correlated error model
Our next step is to fit the correlated error model, but where xt is AR(2).
xt = ϑ1 xt→1 + ϑ2 xt→2 + wt
!P (B s )xi = ”Q (B s )wi ,
!P (B s ) = 1 → !1 B s → !2 B 2s → · · · → !P B Ps
and
”Q (B s ) = 1 + ”1 B s + ”2 B 2s + · · · + ”Q B Qs
are the seasonal autoregressive operator and the seasonal moving
average operator of orders P and Q, respectively, with seasonal period s.
first-order seasonal autoregressive series that might run over months could
be written as
(1 → !B 12 )xt = wt
or
xt = !xt→12 + wt .
This model exhibits the series xt in terms of past lags at the multiple
of the yearly seasonal period s = 12 months.
It is clear from the above form that estimation and forecasting for
such a process involves only straightforward modifications of the unit
lag case already treated.
In particular, the causal condition requires |!| < 1.
xt = wt + ”wt→12 .
We can verify the auto-covariance that,
ε(0) = (1 + ”2 )ϖ 2
ε(±12) = ”ϖ 2
ε(h) = 0 Otherwise
Table: Behavior of the ACF and PACF for Pure SARMA Models
AR(P)s MA(Q)s ARMA(P, Q)s
Tails o# at lags ks, Cuts o# after
ACF Tails o# at lags ks
k = 1, 2, . . . lag Qs
Tails o# at lags ks,
PACF Cuts o# after lag Ps Tails o# lags ks
k = 1, 2, . . .
Note that the values of ACF and PACF at nonseasonal lags h ↑= ks, for
k = 1, 2, · · · , are zero.
and write
!P (B S )ϑ(B)xt = ”Q (B S )ϱ(B)wt .
xt = ϑxt12 + wt + ϱwt1 ,
!P (B s ) ϑ(B)↔D
s ↔ d
x t = ς + ” Q (B s
) ϱ(B)wt ,
where wt is the usual Gaussian white noise process. The general model is
denoted as ARIMA (p, d, q)(P, D, Q)s .
The ordinary AR and MA components are represented by polynomials
ϑ(B) and ϱ(B) of orders p and q, respectively
The seasonal AR and MA components are represented by !P (B s )
and ”Q (B s ) of orders P and Q
Ordinary and seasonal di#erence components by ↔d = (1 → B)d and
↔D = (1 → B s )D
s
Lijia Wang
Last Time:
1 Regression with Auto-correlated Errors
2 Multiplicative Seasonal ARIMA Models
Today:
1 An Example of SARIMA model
2 R code
2 R code
We consider the R data set AirPassengers, which are the monthly totals of
international airline passengers, 1949 to 1960, taken from Box & Jenkins
(1970).
1 Note that x is the original series, which shows trend plus increasing
variance.
2 The logged data are in lx, and the transformation stabilizes the
variance.
3 The logged data are then di!erenced to remove trend, and are stored
in dlx.
4 It is clear the there is still persistence in the seasons, so that a
twelfth-order di!erence is applied and stored in ddlx.
5 The transformed data appears to be stationary and we are now ready
to fit a model.
Figure: Residual analysis for the ARIMA(0, 1, 1) ↑ ARMIA(0, 1, 1)12 fit to the
loggedLijiaairWang
passengers
(UofT) data set. STA457: Time Series Analysis 11 / 13
Forecasting
2 R code