Beruflich Dokumente
Kultur Dokumente
Studying some data from the Mexican Economy with Time Series Models
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando a o Snchez, Miguel Chong a
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
t.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
t.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
x
0 2 4
0 50 100 Index 150 200
0
0
10
15
20
25
30
50 time
100
150
(b) non-Stationary
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
ARMA models
Let p, q be positive integers and let B be the operator Bxt = xt1 . 1. ARMA(p, q) model p (B)Xt = q (B)t , (1)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
ARMA models
Let p, q be positive integers and let B be the operator Bxt = xt1 . 1. ARMA(p, q) model p (B)Xt = q (B)t , 2. where (z) = 1 1 z 2 z 2 p z p , (z) = 1 + 1 z + 2 z 2 + + q z q and {t } a sequence of uncorrelated random variables, such 2 that for all t, t Normal(0, ). (1)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
ARMA models
Let p, q be positive integers and let B be the operator Bxt = xt1 . 1. ARMA(p, q) model p (B)Xt = q (B)t , 2. where (z) = 1 1 z 2 z 2 p z p , (z) = 1 + 1 z + 2 z 2 + + q z q and {t } a sequence of uncorrelated random variables, such 2 that for all t, t Normal(0, ). 3. If data are non-stationary, we may transform these in order to t a model of this class. As in Regression Analysis, checking assumptions and goodness of t is compulsory. (1)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Seasonality
For data with a seasonal component, models of the class SARIMA((p, d, q) (P, D, Q))s are available.
12 6 7 8 thousands 9 10 11
1973
1974
1975 months
1976
1977
1978
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Series 1
50
1996
100
150
200
250
300
350
400
1998
2000
2002
2004
2006
2008
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
SARIMA models
1. Let d, D, s, be positive integers. {Xt } is a SARIMA((p, d, q) (P, D, Q))s process (with period s) if Yt = (1 B)d (1 B s )D Xt is a stationary ARMA process satisfying p (B)P (B s )Yt = q (B)Q (B s )t , (B) (A)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
SARIMA models
1. Let d, D, s, be positive integers. {Xt } is a SARIMA((p, d, q) (P, D, Q))s process (with period s) if Yt = (1 B)d (1 B s )D Xt is a stationary ARMA process satisfying p (B)P (B s )Yt = q (B)Q (B s )t , 2. where p (z) = 1 1 z 2 z 2 p z p , P (z) = 1 1 z 2 z 2 P z P , q (z) = 1 + 1 z + 2 z 2 + + q z q , Q (z) = 1 + 1 z + 2 z 2 + + Q z Q . {t } are uncorrelated and identically distributed as a 2 normal(0, ) r.v. (B) (A)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
We will take data corresponding to the period from January of 2004 to the last week available (September 17th to 21st of 2007) before the missing observation.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
We will take data corresponding to the period from January of 2004 to the last week available (September 17th to 21st of 2007) before the missing observation. Fit a SARIMA model to this data set.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
We will take data corresponding to the period from January of 2004 to the last week available (September 17th to 21st of 2007) before the missing observation. Fit a SARIMA model to this data set. Use the model to forecast the missing datum
2.6 Logaritmo de los datos 1.9
2004
2.0
2.1
2.2
2.3
2.4
2.5
2005
2006
2007
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
{Xt } are (the logarithm in base 10 of) the average weekly prices (10kg box).
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
{Xt } are (the logarithm in base 10 of) the average weekly prices (10kg box). A series of trials leads to dierence at lag 1 corresponding to d = 1, then dierence at lag s = 52 corresponding to D = 1 so that the resulting series {Yt } looks stationary
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
{Xt } are (the logarithm in base 10 of) the average weekly prices (10kg box). A series of trials leads to dierence at lag 1 corresponding to d = 1, then dierence at lag s = 52 corresponding to D = 1 so that the resulting series {Yt } looks stationary Its ACF allows us to choose a SARIMA model
0.8 ACF 0.4
0
0.2
0.0
0.2
0.4
0.6
1.0
20
40
Lag
60
80
100
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
The ACF points to a SARIMA(p = 0, d = 1, q = 7)(P = 0, D = 1, Q = 1)52 model After estimation a residual analysis follows
Series residuals
0.00 0.04
residuals
ACF
2005.0 2006.0 Time 2007.0
0.06
0.2
0
0.2
0.6
1.0
20
60 Lag
100
140
Normal QQ Plot
Histogram of residuals
0.06
0 10 20 30 40 50
0.06
Sample Quantiles
0.00 0.04
Frequency
0.02
0.02
0.06
Theoretical Quantiles
residuals
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Use the model to forecast the missing observation (September 24rd to 28th of 2007).
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Use the model to forecast the missing observation (September 24rd to 28th of 2007). This yields X = 338.26. mxn.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Use the model to forecast the missing observation (September 24rd to 28th of 2007). This yields X = 338.26. mxn. Average weekly price from the previous week is 355 mxn. and for the week after is 320 mxn.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Use the model to forecast the missing observation (September 24rd to 28th of 2007). This yields X = 338.26. mxn. Average weekly price from the previous week is 355 mxn. and for the week after is 320 mxn. Using the completed data set (January 2004 to July of 2008) we can t a SARIMA model and produce forecasts
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
100 2004
150
200
250
300
400
2005
2006
2007
2008
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
1. A vector process {Xt } of dimension K 1 is autoregressive of order p if
p
Xt =
i=1
i Xti + V Zt + + dt + wt + Et ,
(2)
where
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
1. A vector process {Xt } of dimension K 1 is autoregressive of order p if
p
Xt =
i=1
i Xti + V Zt + + dt + wt + Et ,
(2)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
1. A vector process {Xt } of dimension K 1 is autoregressive of order p if
p
Xt =
i=1
i Xti + V Zt + + dt + wt + Et ,
(2)
where 2. {i }p are K K dimensional matrices of coecients. 1 3. Zt are exogenous variables (covariates), dt vector of seasonal dummies, wt vector of intervention dummies.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
1. A vector process {Xt } of dimension K 1 is autoregressive of order p if
p
Xt =
i=1
i Xti + V Zt + + dt + wt + Et ,
(2)
where 2. {i }p are K K dimensional matrices of coecients. 1 3. Zt are exogenous variables (covariates), dt vector of seasonal dummies, wt vector of intervention dummies. 4. {Et } is a sequence of uncorrelated vectors such that Et NK (0, ) for each t
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
1. A vector process {Xt } of dimension K 1 is autoregressive of order p if
p
Xt =
i=1
i Xti + V Zt + + dt + wt + Et ,
(2)
2. 3. 4. 5.
where {i }p are K K dimensional matrices of coecients. 1 Zt are exogenous variables (covariates), dt vector of seasonal dummies, wt vector of intervention dummies. {Et } is a sequence of uncorrelated vectors such that Et NK (0, ) for each t , V , , are vectors and matrices (parameters) of the appropriate dimensions.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
Gathering all covariates Zt , dt , wt and , in a M 1 dimensional vector Yt we can write (2) as
p
Xt =
i=1
i Xti + BYt + Et ,
(2)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
Gathering all covariates Zt , dt , wt and , in a M 1 dimensional vector Yt we can write (2) as
p
Xt =
i=1
i Xti + BYt + Et ,
(2)
Xt =
i=1
i Xti + 0 + Et ,
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
VAR(p) models
Gathering all covariates Zt , dt , wt and , in a M 1 dimensional vector Yt we can write (2) as
p
Xt =
i=1
i Xti + BYt + Et ,
(2)
Xt =
i=1
i Xti + 0 + Et ,
is suitable for vectors Xt where each component is a stationary process. however the model in (2) can be used for the case where each component is not stationary
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Cointegration
The components of the vector Xt cointegrate if
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Cointegration
The components of the vector Xt cointegrate if each component Xi,t of Xt is I (1) : Xi,t = Xi,t Xi,t1 is a stationary process i = 1, . . . , K .
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Cointegration
The components of the vector Xt cointegrate if each component Xi,t of Xt is I (1) : Xi,t = Xi,t Xi,t1 is a stationary process i = 1, . . . , K . There is an h (K + M) dimensional matrix + (h 1) such Xt the h components of the vector + are stationary Yt processes.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Cointegration
The components of the vector Xt cointegrate if each component Xi,t of Xt is I (1) : Xi,t = Xi,t Xi,t1 is a stationary process i = 1, . . . , K . There is an h (K + M) dimensional matrix + (h 1) such Xt the h components of the vector + are stationary Yt processes. write (2) in the so called error correction model (VECM or VAR in Xt )
p1
AXt =
i=1
i Xti +
Xt Yt
+ Yt + Et .
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Cointegration
The components of the vector Xt cointegrate if each component Xi,t of Xt is I (1) : Xi,t = Xi,t Xi,t1 is a stationary process i = 1, . . . , K . There is an h (K + M) dimensional matrix + (h 1) such Xt the h components of the vector + are stationary Yt processes. write (2) in the so called error correction model (VECM or VAR in Xt )
p1
AXt =
i=1
i Xti +
Xt Yt
+ Yt + Et .
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Assuming that the model (2) is appropriate (check residuals), we can estimate the matrix + . The estimated parameters furnishes us with economical interpretations
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
(1)
IMWNU 15.0
12.5
10.0
7.5
5.0
2.5
1990
1995
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
DES 27.5
25.0
22.5
20.0
17.5
(1)
150
IMYBR
140
130
120
110
100
(2)
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Right or Wrong ?
From this error correction model a cointegration (long run) relationship is estimated as the stationary process t given by
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Right or Wrong ?
From this error correction model a cointegration (long run) relationship is estimated as the stationary process t given by X1,t 0.88X2,t + 0.29Zt 0.10X3,t = t
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Right or Wrong ?
From this error correction model a cointegration (long run) relationship is estimated as the stationary process t given by X1,t 0.88X2,t + 0.29Zt 0.10X3,t = t namely, in the long run we have X1,t = 0.88X2,t 0.29Zt + 0.10X3,t
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Some references
Brockwell D. and Davis R. Time series : theory and applications. Springer Verlag
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong
Some references
Brockwell D. and Davis R. Time series : theory and applications. Springer Verlag Ltkepohl, H. New Introduction to Multiple Time Series u Analysis. Springer Verlag.
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong