1Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
5 – Autoregressive Integrated Moving
Average (ARIMA) Models
5 – Autoregressive Integrated Moving
Average (ARIMA) Models
2Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARIMA Box-Jenkins Methodology
3Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Index
Index
60544842363024181261
290
280
270
260
250
240
230
220
210
Time Series Plot of Index
The series show an upward trend.
Lag
Auto
corr
ela
tion
16151413121110987654321
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Autocorrelation Function for Index(with 5% significance limits for the autocorrelations)
The first several autocorrelations are persistently large and trailed off to zero rather slowly a trend exists and this time series is nonstationary (it does not vary about a fixed level)
Idea: to difference the data to see if we could eliminate the trend and create a stationary series.
Example 1/4
4Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
First order differences.
A plot of the differenced data appears to vary about a fixed level.
Index
Diff1
60544842363024181261
5
4
3
2
1
0
-1
-2
-3
-4
Time Series Plot of Diff1
Lag
Auto
corr
ela
tion
16151413121110987654321
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Autocorrelation Function for Diff1(with 5% significance limits for the autocorrelations)
Lag
Part
ial A
uto
corr
ela
tion
16151413121110987654321
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Partial Autocorrelation Function for Diff1(with 5% significance limits for the partial autocorrelations)
Comparing the autocorrelations with their error limits, the only significant autocorrelation is at lag 1. Similarly, only the lag 1 partial autocorrelation is significant. The PACF appears to cut off after lag 1, indicating AR(1) behavior. The ACF appears to cut off after lag 1, indicating MA(1) behavior we will try: ARIMA(1,1,0) and ARIMA(0,1,1)
A constant term in each model will be included to allow for the fact that the series of differences appears to vary about a level greater than zero.
Example 2/4
5Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARIMA(1,1,0)ARIMA(0,1,1)
Example 3/4
The LBQ statistics are not significant as indicated by the large p-values for either model.
6Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Lag
Auto
corr
ela
tion
16151413121110987654321
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Autocorrelation Function for RESI1(with 5% significance limits for the autocorrelations)
Lag
Auto
corr
ela
tion
16151413121110987654321
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Autocorrelation Function for RESI2(with 5% significance limits for the autocorrelations)
Therefore, either model is adequate and provide nearly the same one-step-ahead forecasts.
Example 4/4
Finally, there is no significant residual autocorrelation for the ARIMA(1,1,0) model. The results for the ARIMA(0,1,1) are similar.
7Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Makridakis– ARIMA 7.1– ARIMA PIGS– ARIMA DJ– ARIMA Electricity– ARIMA Computers– ARIMA Sales Industry– ARIMA Pollution
Examples
Minitab– Employ (Food)
Montgomery– EXEMPLO PAG 267– EXEMPLO PAG 271– EXEMPLO PAG 278– EXEMPLO PAG 283
8Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARIMA Basic Model
9Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Basic Models
ARIMA (0, 0, 0) ― WHITE NOISE
ARIMA (0, 1, 0) ― RANDOM WALK
ARIMA (1, 0, 0) ― AUTOREGRESSIVE MODEL (order 1)
ARIMA (0, 0, 1) ― MOVING AVERAGE MODEL (order 1)
ARIMA (1, 0, 1) ― SIMPLE MIXED MODEL
10Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR MA Example Models
ARIMA (0,0,1)=MA(1)
ARIMA (1,0,0)= AR(1)
ARIMA (0,0,2)= MA(2)
ARIMA (2,0,0)= AR(2)
11Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARMA Example Models
ARIMA(1,01)=ARMA(1,1)
ARIMA(1,01)=ARMA(1,1)
12Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Autocorrelation - ACF
Lag ACF T LBQ 1 0,0441176 0,15 0,03 2 -0,0916955 -0,32 0,17Diferenças são devido a pequenas
modificações nas fórmulas de Regressão e Time Series
13Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Correlation
• Suppose X, Y and Z are random variables. We define the notion of partial correlation between X and Y adjusting for Z.
• First consider simple linear regression of X on Z
• Also the linear regression of Y on Z
ZVar
XZCovbZbaX
,whereˆ
111
ZVar
YZCovbZbaY
,whereˆ
222
14Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Correlation
• Now consider the errors
• Then the partial correlation between X and Y, adjusting for Z, is
ZbaYYYY
ZbaXXXX
22*
11*
ˆ
ˆ
YYXXcorrYXcorr ˆ,ˆ, **
15Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Autocorrelation - PACF
Diferenças são devido a pequenas modificações nas fórmulas de
Regressão e Time Series
Correlations: X*; Y* Pearson correlation of X* and Y* =0,770P-Value = 0,000
Partial Autocorrelation Function: X Lag PACF T 1 0,900575 6,98 2 -0,151346 -1,17 3 0,082229 0,64
16Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF 0
PACF = 0 for lag > 1
Theorectical Behavior for AR(1)
0 1 1 2 2 ...t t t p t p tY Y Y Y 0 1 1 2 2 ...t t t p t p tY Y Y Y
17Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Theorectical Behavior for AR(2)
ACF 0
PACF = 0 for lag > 2
0 1 1 2 2 ...t t t p t p tY Y Y Y 0 1 1 2 2 ...t t t p t p tY Y Y Y
18Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
PACF 0
ACF = 0 for lag > 1
Theorectical Behavior for MA (1)
1 1 2 2 ...t t t t q t qY 1 1 2 2 ...t t t t q t qY
19Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Theorectical Behavior for MA(2)
PACF 0
PACF = 0 for lag > 2
1 1 2 2 ...t t t t q t qY 1 1 2 2 ...t t t t q t qY
20Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Note that:
• ARMA(p,0) = AR(p)
• ARMA(0,q) = MA(q)
0 1 1 2 2 1 1 2 2... ...t t t p t p t t t q t qY Y Y Y 0 1 1 2 2 1 1 2 2... ...t t t p t p t t t q t qY Y Y Y
In practice, the values of p and q each rarely exceed 2.
ACF PACF
AR(p) Die out Cut off after the order p of the process
MA(q) Cut off after the order q of the process
Die out
ARMA(p,q) Die out Die out
In this context…
• “Die out” means “tend to zero gradually”
• “Cut off” means “disappear” or “is zero”
Theorectical Behavior
21Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Review of Main Characteristics of ACF and PACF
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.,
lagafterofcuts sinusoid damped
and/or decay exp. sinusoid damped
and/or decay exp.lagafterofcuts
qpARMA
ppAR
qqMA
PACFACF
22Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1• Weekly total number of loan applications
1009080706050403020101
90
80
70
60
50
Index
Applic
ations
EXEMPLO PAG 267.MPJ
The weekly data tend to have short runs and that the data seem to be indeed autocorrelated. Next, we visually inspect the stationarity. Although there might be a slight drop in the mean for the second year (weeks 53-104 ), in general it seems to be safe to assume stationarity.
23Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
23
Example 5.1
2624222018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
Autocorrelation Function for Applications(with 5% significance limits for the autocorrelations)
2. It has an (or a mixture ot) exponential decay(s) pattern suggesting an AR(p) model.
1. It cuts off after lag 2 (or maybe even 3), suggesting a MA(2) (or MA(3)) model.
24Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
2624222018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Partial Autocorrelation Function for Applications(with 5% significance limits for the partial autocorrelations)
24
Example 5.1
It cuts off after lag 2. Hence we use the second interpretation of the sample ACF plot and assume that the appropriate model to fit is the AR(2) model.
25Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
The modified Box-Pierce test suggests that there is no autocorrelation left in the
residuals.
26Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
2624222018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
2624222018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Autocorrelation Function for RESI1(with 5% significance limits for the autocorrelations)
Partial Autocorrelation Function for RESI1(with 5% significance limits for the partial autocorrelations)
27Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
20100-10-20
99,9
99
90
50
10
1
0,1
Residual
Perc
ent
8075706560
20
10
0
-10
Fitted Value
Resi
dual
151050-5-10
20
15
10
5
0
Residual
Fre
quency
1009080706050403020101
20
10
0
-10
Observation Order
Resi
dual
Normal Probability Plot Versus Fits
Histogram Versus Order
28Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
1009080706050403020101
90
80
70
60
50
Index
Data
ApplicationsFITS1
Variable
29Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
• Dow Jones Index
80726456484032241681
12000
11000
10000
9000
8000
Index
Dow
Jones
The process shows signs of nonstationarity with
changing mean and possibly variance.
Exemplo: Página 271
30Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
2018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
Autocorrelation Function for Dow Jones(with 5% significance limits for the autocorrelations)
The slowly decreasing sample ACF and sample PACF with significant value at lag 1, which is close to 1 confirm that indeed
the process can be deemed nonstationary.
31Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
2018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Partial Autocorrelation Function for Dow Jones(with 5% significance limits for the partial autocorrelations)
Example 5.2
One might argue that the significant sample PACF value at lag I suggests that the AR( I) model might also fit the data well. We will consider this interpretation first and fit an AR( I) model to the Dow Jones Index data.
32Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
The modified Box-Pierce test suggests that there is no autocorrelation left in the residuals. This is also confirmed by the sample ACF and PACF plots of the residuals
33Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
2018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
2018161412108642
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Autocorrelation Function for RESI1(with 5% significance limits for the autocorrelations)
Partial Autocorrelation Function for RESI1(with 5% significance limits for the partial autocorrelations)
34Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
10005000-500-1000
99,9
99
90
50
10
1
0,1
Residual
Perc
ent
110001000090008000
1000
500
0
-500
-1000
Fitted Value
Resi
dual
8004000-400-800-1200
20
15
10
5
0
Residual
Fre
quency
80706050403020101
1000
500
0
-500
-1000
Observation Order
Resi
dual
Normal Probability Plot Versus Fits
Histogram Versus Order
Residual Plots for Dow Jones
Example 5.2
The only concern in the residual plots in is in the changing variance observed in the time series plot of the residuals.
35Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
36Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
37Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
38Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
39Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.3
1009080706050403020101
90
80
70
60
50
Week
Applic
ations
Prediction with AR(2)
Exemplo pag 278
40Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.3
1101009080706050403020101
90
80
70
60
50
Time
Applic
ations
Time Series Plot for Applications(with forecasts and their 95% confidence limits)
41Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.3
42Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5• U.S. Clothing Sales Data
ago-03jun-02abr-01fev-00dez-98out-97ago-96jun-95abr-94fev-93jan-92
17500
15000
12500
10000
7500
5000
Date
Sale
s
The data obviously exhibit some seasonality and upward linear trend. c
Exemplo: Página 283
43Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
35302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
Autocorrelation Function for Sales(with 5% significance limits for the autocorrelations)
The sample ACF and PACF indicate a monthly seasonality, s = 12, as ACF values at lags 12, 24, 36 are significant and slowly decreasing
44Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
35302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
Autocorrelation Function for Sales(with 5% significance limits for the autocorrelations)
The sample ACF and PACF indicate a monthly seasonality, s = 12, as ACF values at lags 12, 24, 36 are significant and slowly decreasing
45Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
35302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Partial Autocorrelation Function for Sales(with 5% significance limits for the partial autocorrelations)
Example 5.5
There is a significant PACF value at lag 12 that is close to 1. Moreover, the slowly decreasing ACF in general also indicates a nonstationarity that can be remedied by taking the first difference. Hence we would now consider
46Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
47Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
35302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Partial Autocorrelation Function for Sales(with 5% significance limits for the partial autocorrelations)
Example 5.5
There is a significant PACF value at lag 12 that is close to 1. Moreover, the slowly decreasing ACF in general also indicates a nonstationarity that can be remedied by taking the first difference. Hence we would now consider
48Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
ago-03jun-02abr-01fev-00dez-98out-97ago-96jun-95abr-94fev-93jan-92
1500
1000
500
0
-500
-1000
Date
Com
p D
if
Figure shows that first difference together with seasonal differencing helps in terms of stationarity and eliminating the seasonality
49Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
Autocorrelation Function for Comp Dif(with 5% significance limits for the autocorrelations)
50Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Partial Autocorrelation Function for Comp Dif(with 5% significance limits for the partial autocorrelations)
The sample ACF with a significant value at lag 1 and the sample PACF with exponentially decaying values at the first 8 lags suggest that a nonseasonal MA( I) model should be used.
51Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
The interpretation of the remaining seasonality is a bit more difficult. For that we should focus on the sample ACF and PACF values at lags 12. 24, 36, and so on. The sample ACF at lag 12 seems to be significant and the sample PACF at lags 12, 24, 36 (albeit not significant) seems to be alternating in sign. That suggests that a seasonal MA(1) model can be used as well. Hence an ARIMA (0, 1, 1) x (0, 1, 1) 12 model is used to model the data, yt
52Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
53Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
Both MA( 1) and seasonal MA( 1) coefficient estimates are significant.
As we can see from the sample ACF and PACF plots, while there are still some small significant values, as indicated by the modified Box-Pierce statistic, most of the autocorrelation is now modeled out.
54Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Auto
corr
ela
tion
302520151051
1,0
0,8
0,6
0,4
0,2
0,0
-0,2
-0,4
-0,6
-0,8
-1,0
Lag
Part
ial A
uto
corr
ela
tion
Autocorrelation Function for RESI1(with 5% significance limits for the autocorrelations)
Partial Autocorrelation Function for RESI1(with 5% significance limits for the partial autocorrelations)
As we can see from the sample ACF and PACF plots, while there are still some small significant values, as indicated by the modified Box-Pierce statistic, most of the autocorrelation is now modeled out.
55Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
10005000-500-1000
99,9
99
90
50
10
1
0,1
Residual
Perc
ent
18000150001200090006000
500
0
-500
-1000
Fitted Value
Resi
dual
6003000-300-600-900
20
15
10
5
0
Residual
Fre
quency
140
130
120
110
1009080706050403020101
500
0
-500
-1000
Observation Order
Resi
dual
Normal Probability Plot Versus Fits
Histogram Versus Order
56Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
15614413212010896847260483624121
20000
17500
15000
12500
10000
7500
5000
Time
Sale
s
Time Series Plot for Sales(with forecasts and their 95% confidence limits)
57Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Introduction
Exponential smoothing. The general assumption for these models was that any time series data can be represented as the sum of two distinct components: deterministic and stochastic (random). The former (deterministic) is modeled as a function of time whereas for the latter (stochastic) we assumed that some random noise that is added on the deterministic signal generates the stochastic behavior of the time series.
One very important assumption is that the random noise is generated through independent shocks to the process.
In practice, however, this assumption is often violated. That is, usually successive observations show serial dependence. Under these circumstances, forecasting methods based on exponential smoothing may be inefficient and sometimes inappropriate because they do not take advantage of the serial dependence in the observations in the most effective way.
To formally incorporate this dependent structure, we will explore a general class of models called autoregressive integrated moving average models or ARIMA models (also known as Box-Jenkins models).
58Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Linear Models for Stationary Time Series
• A linear filter is defined as
is said to be
Um conceito de Processamento
de Sinais
59Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Stationarity
60Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
61Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Stationary Time Series
• Many time series do not exhibit a stationary behavior
• The stationarity is in fact a rarity in real life
• However it provides a foundation to build upon since (as we will see later on) if the time series in not stationary, its first difference (yt-yt-1) will often be
62Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Linear Filter
63Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
If Input is White Noise
64Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Using the Backshift Operator
65Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Wold’s Decomposition Theorem
• Any nondeterministic weakly stationary time series can be written as an infinite sum of weighted random shocks (disturbances)
0iitity
0
2
ii
where
66Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
How useful is this?
Well, not so much!!!
How can we come up with “infinitely” many terms?
67Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Maybe we should consider some special cases:
68Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Finite Order Moving Average Processes (Ma(q))
69Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Properties
• Expected Value
• Variance
70Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Properties
• Autocovariance Function
• Autocorrelation Function (ACF)
71Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Autocorrelation Function of MA(q)
• ACF of Ma(q) ”cuts off” after lag q
• This is very useful in the identification of an MA(q) process
72Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example
Employ.mtw
73Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Diferences
74Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Because you did not specify the lag length, autocorrelation uses the default length of n / 4 for a series with less than or equal to 240 observations. Minitab generates an autocorrelation function (ACF) with approximate a = 0.05 critical bands for the hypothesis that the correlations are equal to zero.
The graphs for the autocorrelation function (ACF) of the ARIMA residuals include lines representing two standard errors to either side of zero. Values that extend beyond two standard errors are statistically significant at approximately a = 0.05, and show evidence that the model does not explain thel autocorrelation in the data.
Autocorrelation
75Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The ACF for these data shows large positive, significant spikes at lags 1 and 2 with subsequent positive autocorrelations that do not die off quickly. This pattern is typical of an autoregressive process.
Autocorrelation
76Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Ljung-Box q statisticUse to test whether a series of observations over time are random and independent. If observations are not independent, one observation may be correlated with another observation k time units later, a relationship called autocorrelation. Autocorrelation can impair the accuracy of a time-based predictive model, such as time series plot, and lead to misinterpretation of the data.For example, an electronics company tracks monthly sales of batteries for five years. They want to use the data to develop a time series model to help forecast future sales. However, monthly sales may be affected by seasonal trends. For example, every year a rise in sales occurs when people buy batteries for Christmas toys. Thus a monthly sales observation in one year could be correlated with a monthly sales observations 12 months later (a lag of 12). Before choosing their time series model, they can evaluate autocorrelation for the monthly differences in sales. The Ljung-Box Q (LBQ) statistic tests the null hypothesis that autocorrelations up to lag k equal zero (i.e., the data values are random and independent up to a certain number of lags--in this case 12). If the LBQ is greater than a specified critical value, autocorrelations for one or more lags may be significantly different from zero, suggesting the values are not random and independent over time.LBQ is also used to evaluate assumptions after fitting a time series model, such as ARIMA, to ensure that the residuals are independent.The Ljung-Box is a Portmanteau test and is a modified version of the Box-Pierce chi-square statistic.
77Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
You can use the Ljung-Box Q (LBQ) statistic to test the null hypothesis that the autocorrelations for all lags up to lag k equal zero. Let's test that all autocorrelations up to a lag of 6 are zero. The LBQ statistic is 56.03.
Ho: Autocorrelation (lag<6) = 0
Variable CumProb is created
78Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
79Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
In this example, the p-value is 0.000000, which means the p-value is less than 0.0000005. The very small p-value implies that one or more of the autocorrelations up to lag 6 can be judged as significantly different from zero at any reasonable a level.
80Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial autocorrelation computes and plots the partial autocorrelations of a time series. Partial autocorrelations, like autocorrelations, are correlations between sets of ordered data pairs of a time series. As with partial correlations in the regression case, partial autocorrelations measure the strength of relationship with other terms being accounted for. The partial autocorrelation at a lag of k is the correlation between residuals at time t from an autoregressive model and observations at lag k with terms for all intervening lags present in the autoregressive model. The plot of partial autocorrelations is called the partial autocorrelation function or PACF. View the PACF to guide your choice of terms to include in an ARIMA model.
81Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
You obtain a partial autocorrelation function (PACF) of the food industry employment data, after taking a difference of lag 12, in order to help determine a likely ARIMA model.
82Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Minitab generates a partial autocorrelation function with critical bands at approximately a = 0.05 for the hypothesis that the correlations are equal to zero. In the food data example, there is a single large spike of 0.7 at lag 1, which is typical of an autoregressive process of order one. There is also a significant spike at lag 9, but you have no evidence of a nonrandom process occurring there.
83Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
84Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Sample ACF
• Will not be equal to zero after lag q for an MA(q)
• But it will be small
• For the same size of N, this can be tested using the limits:
N2
85Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
First-Order Moving Average Process MA(1)
for which autocovariance and autocorrelation functions are given as
86Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
Note, the behaviorof sample ACF
87Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Second-Order Moving Average Process MA(2)
for which autocovariance and autocorrelation functions are given as
88Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
An Example
89Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Finite Order Autoregressive Processes (AR(p))
• MA(q) processes take into account disturbances up to q lags in the past
• What if all past disturbances have some lingering effects? Back to square one?
• We may be able to come up with some special cases though
90Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
A very special case
• What if we let
1for jj
91Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Decomposition
10 iit
it
iit
ity
and
11
011
iit
it
iit
ity
92Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Combining the two equations
t
iit
i
iit
itt yy
01
01
ttt ayy 1
This is an AR(1) model
93Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
First-Order Autoregressive Process (AR(1))
ttt ayy 1
94Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Properties
• Expected Value
• Autocovariance Function
• Autocorrelation Function
95Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
96Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Second-Order Autoregressive Process (AR(2))
97Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Conditions for Stationarity
t
t
B
t
tt
tt
tttt
B
BBy
yB
yBB
yyy
11
221
2211
1
98Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR(2) is stationary if …
0
aswritecanwei
iiBB
1
11
1Since
2211
2021120110
221021
jjjj B
BB
BBBB
BB
99Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR(2) is stationary if …
20
0
0
1
2211
02112
011
0
jjjj
100Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR(2)
• Hence {j} satisfy the 2nd order linear difference equation. So the i can be expressed as the solution to this equation in terms of the 2 roots m1 and m2 of the associated polynomial
• If the roots m1 and m2 satisfy
0212 mm
021 then1,
jjmm
jjj mcmcrealaremmge 221121 then,..
101Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR(2) is stationary if the roots m1 and m2
of are both less than
one in absolute value
0212 mm
102Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF of a stationary AR(2)
00
021
,,,
,
,
2
21
2211
2211
kif
kifkk
yCovyyCovyyCov
yyyCov
yyCovk
kttkttktt
ktttt
ktt
103Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF of a stationary AR(2)
,2,121
,2,121
210
21
21
221
kkkk
kkkk
Yule-WalkerEquations
104Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF of a stationary AR(2)
• Hence ACF satisfies the 2nd order linear difference equation. So the (k) can be expressed as the solution to this equation in terms of the 2 roots m1 and m2 of the associated polynomial
0212 mm
105Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF of a stationary AR(2)
106Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
107Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR(p)
p
p
tt
t
p
iitit
BBBB
yB
yy
221
1
1where
108Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
AR(p) is Stationary
• If the roots of
are less than one in absolute value.
022
11
pppp mmm
109Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Infinite MA representation
110Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Expected Value of an AR(p)
111Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Autocovariance Function of an AR(p)
112Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Autocorrelation Function of an AR(p)
113Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF of AR(p)
,2,11
kikkp
ii
In general ACF of AR(p) can be a mixtureof exponential decay and damped sinusoidal behavior depending on the solution to the corresponding Yule-Walker equations.
114Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF of AR(p)
115Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF for AR(p) and MA(q)
• ACF of MA(q) “cuts off” after q
• ACF of AR(p) can be a mixture of exponential decay and damped sinusoidal
qk
qkk
q
qkqkk
y
,,0
01 22
22
1
11
116Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
So how are we going to determine p in the AR(p)
model?
117Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Correlation
• Suppose X, Y and Z are random variables. We define the notion of partial correlation between X and Y adjusting for Z.
• First consider simple linear regression of X on Z
• Also the linear regression of Y on Z
ZVar
XZCovbZbaX
,whereˆ
111
ZVar
YZCovbZbaY
,whereˆ
222
118Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Correlation
• Now consider the errors
• Then the partial correlation between X and Y, adjusting for Z, is
ZbaYYYY
ZbaXXXX
22*
11*
ˆ
ˆ
YYXXcorrYXcorr ˆ,ˆ, **
119Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Autocorrelation Function (PACF)
120Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Autocorrelation Function (PACF)
121Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Autocorrelation Function (PACF)
122Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Partial Autocorrelation Function (PACF)
123Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Sample Partial Autocorrelation Function
124Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
125Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
PACF
• For an AR(p) process, PACF cuts off after lag p.
• For an MA(q) process, PACF has an exponential decay and/or a damped sinusoid form
126Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Invertibility of a MA Process
127Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Invertibility of a MA Process
128Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Invertibility of a MA Process
We have
129Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The ACF and PACF do have very distinct and indicative properties for MA and AR models. Therefore in model identification it is strongly recommended to use both the sample ACF and PACF simultaneously
130Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Mixed Autoregressive-Moving Average (ARMA(p,q)) Process
tt ByB
131Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Stationarity of ARMA(p,q)
132Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Invertibility of ARMA(p,q)
133Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ACF and PACF of an ARMA(p,q)
• Both ACF and PACF of an ARMA(p,q) can be a mixture of exponential decay and damped sinusoids depending on the roots of the AR operator.
134Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARMA Models
• For ARMA models, except for possible special cases, neither ACF nor PACF has distinctive features that would allow “easy identification”
• For this reason, there have been many additional sample functions considered to help with identification problem:– Extended sample ACF (ESACF)– Generalized sample PACF (GPACF)– Inverse ACF– Use of “canonical correlations”
135Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
136Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Review of Main Characteristics of ACF and PACF
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.,
lagafterofcuts sinusoid damped
and/or decay exp. sinusoid damped
and/or decay exp.lagafterofcuts
qpARMA
ppAR
qqMA
PACFACF
137Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Review of Main Characteristics of Sample ACF and PACF
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.,
for1
ˆ
for0ˆ
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.
for1
ˆ
for0ˆSampleSample
qpARMA
pkT
Var
pkEpAR
qkT
Var
qkEqMA
PACFACF
138Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
139Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
140Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
141Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
142Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
143Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARIMA Models
• Process {yt} is ARIMA(p,d,q), if the dth order differences, wt=(1-B)dyt, form a stationary ARMA(p,q) process:
• Thus {yt} satisfies
ttd ByBB 1
tt BwB
144Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
145Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Some Examples
146Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Model Building
• Given T observations from a process, want to obtain a model that adequately represents the main features of the time series data. Model can be used for purposes of forecasting, control, …
147Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
3-Stage Procedure
• STAGE 1: Model Specification or Identification– Consider issue of nonstationarity vs.
stationarity of series. Use procedures such as differencing to obtain a stationary series; say wt=(1-B)dyt
• Examine sample ACF and PACF of wt and use features of these functions to identify an appropriate ARMA model. The specification is “tentative”
148Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Review of Main Characteristics of ACF and PACF
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.,
lagafterofcuts sinusoid damped
and/or decay exp. sinusoid damped
and/or decay exp.lagafterofcuts
qpARMA
ppAR
qqMA
PACFACF
149Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Review of Main Characteristics of Sample ACF and PACF
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.,
for1
ˆ
for0ˆ
sinusoid damped
and/or decay exp.
sinusoid damped
and/or decay exp.
for1
ˆ
for0ˆSampleSample
qpARMA
pkT
Var
pkEpAR
qkT
Var
qkEqMA
PACFACF
150Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
ARMA Models
• For ARMA models, except for possible special cases, neither ACF nor PACF has distinctive features that would allow “easy identification”
• For this reason, there have been many additional sample functions considered to help with identification problem:– Extended sample ACF (ESACF)– Generalized sample PACF (GPACF)– Inverse ACF– Use of “canonical correlations”
151Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
3-Stage Procedure
• STAGE 2: Estimation of Parameters in Tentatively Specified Model– Method of moments– Least Squares– Maximum Likelihood
152Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
3-Stage Procedure
• STAGE 3: Model Checking– Based on examining features of residuals
q
iiti
p
iititt yy
11
ˆˆˆˆˆ
153Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
3-Stage Procedure
• STAGE 3: If the specified model is appropriate order p, q; then we expect the residuals behave similar to the “true” white noise t.
154Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
• Weekly total number of loan applications
155Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
155
Example 5.1
156Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
157Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
158Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
159Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
160Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.1
161Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
• Dow Jones Index
162Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
163Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
164Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
165Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
166Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
167Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
168Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
169Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
170Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.2
171Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Forecasting ARIMA Processes
172Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Forecasting ARIMA Processes
173Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The “best” forecast
174Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Forecast Error
175Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Prediction Intervals
176Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Two Issues
177Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Illustration Using ARIMA(1,1,1)
• ARIMA(1,1,1) process is given as
• Two commonly used approaches
TT ByBB 111
178Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Approach 1
179Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Approach 2
180Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.3
181Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Seasonal Processes
182Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Seasonal Processes
183Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Seasonal Processes
184Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Seasonal Processes
185Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.4
186Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
• U.S. Clothing Sales Data
187Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
188Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
189Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
190Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
191Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
192Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
193Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
194Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
195Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Example 5.5
196Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Use ARIMA to model time series behavior and to generate forecasts. ARIMA fits a Box-Jenkins ARIMA model to a time series. ARIMA stands for Autoregressive Integrated Moving Average with each term representing steps taken in the model construction until only random noise remains. ARIMA modeling differs from the other time series methods in the fact that ARIMA modeling uses correlational techniques. ARIMA can be used to model patterns that may not be visible in plotted data.
197Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The ACF and PACF of the food employment data suggest an autoregressive model of order 1, or AR(1), after taking a difference of order 12. You fit that model here, examine diagnostic plots, and examine the goodness of fit. To take a seasonal difference of order 12, you specify the seasonal period to be 12, and the order of the difference to be 1.
198Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
1 Model is specified by the usual notation (pdq) x (PDQ) S: (pdq) is for a nonseasonal model; (PDQ) for a seasonal, and S is the seasonality.
2 At least one of the p, P, q, or Q parameters must be non-zero, and none may exceed five.3 The maximum number of parameters you can estimate is ten.4 At least three data points must remain after differencing. That is, S * D + d + 2 must be less than the number of points, where S is the length of a season.5 The maximum "back order" for the model is 100. In practice, this condition is always satisfied if S * D + d + p + P + q + Q is at most 100.6 The ARIMA model normally includes a constant term only if there is no differencing (that is, d = D = 0).7 Missing observations are only allowed at the beginning or the end of a series, not in the middle.8 The seasonal component of this model is multiplicative, and thus is appropriate when the amount of cyclical variation is proportional to the mean.
199Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The ARIMA model converged after nine iterations. The AR(1) parameter had a t-value of 7.42. As a rule of thumb, you can consider values over two as indicating that the associated parameter can be judged as significantly different from zero. The MSE (1.1095) can be used to compare fits of different ARIMA models.The Ljung-Box statistics give nonsignificant p-values , indicating that the residuals appeared to uncorrelated. The ACF and PACF of the residuals corroborate this. You assume that the spikes in the ACF and PACF at lag 9 are the result of random events
The coefficients are estimated using an iterative algorithm that calculates least squares estimates. At each iteration, the back forecasts are computed and SSE is calculated.
Back forecasts are calculated using the specified model and the current iteration's parameter estimates
200Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
Box and Jenkins [2] present an interactive approach for fitting ARIMA models to time series. This iterative approach involves identifying the model, estimating the parameters, checking model adequacy, and forecasting, if desired. The model identification step generally requires judgment from the analyst.1 First, decide if the data are stationary. That is, do the data possess constant mean and variance . · Examine a time series plot to see if a transformation is required to give constant variance. · Examine the ACF to see if large autocorrelations do not die out, indicating that differencing may be required to give a constant mean.
A seasonal pattern that repeats every kth time interval suggests taking the kth difference to remove a portion of the pattern. Most series should not require more than two difference operations or orders. Be careful not to overdifference. If spikes in the ACF die out rapidly, there is no need for further differencing. A sign of an overdifferenced series is the first autocorrelation close to -0.5 and small values elsewhere.
201Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
2 Next, examine the ACF and PACF of your stationary data in order to identify what autoregressive or moving average models terms are suggested. · An ACF with large spikes at initial lags that decay to zero or a PACF with a large spike at the first and possibly at the second lag indicates an autoregressive process. · An ACF with a large spike at the first and possibly at the second lag and a PACF with large spikes at initial lags that decay to zero indicates a moving average process.· The ACF and the PACF both exhibiting large spikes that gradually die out indicates that both autoregressive and moving averages processes are present. For most data, no more than two autoregressive parameters or two moving average parameters are required in ARIMA models.
202Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
3 Once you have identified one or more likely models, you are ready to use the ARIMA procedure.· Fit the likely models and examine the significance of parameters and select one model that gives the best fit. · Check that the ACF and PACF of residuals indicate a random process, signified when there are no large spikes. You can easily obtain an ACF and a PACF of residual using ARIMA's Graphs subdialog box. If large spikes remain, consider changing the model.· You may perform several iterations in finding the best model. When you are satisfied with the fit, go ahead and make forecasts.
The ARIMA algorithm will perform up to 25 iterations to fit a given model. If the solution does not converge, store the estimated parameters and use them as starting values for a second fit. You can store the estimated parameters and use them as starting values for a subsequent fit as often as necessary.
203Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The graphs for the ACF and PACF of the ARIMA residuals include lines representing two standard errors to either side of zero. Values that extend beyond two standard errors are statistically significant at approximately a = 0.05, and show evidence that the model has not explained all autocorrelation in the data.
204Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
205Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The AR(1) model appears to fit well so you use it to forecast employment.
206Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
207Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
208Previsão | Pedro Paulo Balestrassi | www.pedro.unifei.edu.br
The ARIMA algorithm is based on the fitting routine in the TSERIES package written by Professor William Q. Meeker, Jr., of Iowa State University. • W.Q. Meeker, Jr. (1977). "TSERIES-A User-oriented Computer Program for Identifying, Fitting and Forecasting ARIMA Time Series Models," ASA 1977 Proceedings of the Statistical Computing Section.• W.Q. Meeker, Jr. (1977). TSERIES User's Manual, Statistical Laboratory, Iowa State University.
Top Related