Sie sind auf Seite 1von 51

Stationary Processes ARMA models

Studying some data from the Mexican Economy with Time Series Models
Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando a o Snchez, Miguel Chong a

XXV Foro Nacional de Estad stica, 2010

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

2nd order Stationarity


A discrete time stochastic process {Xt , t = 0, 1, . . . } is stationary (second order) if its moments of order 2 exist and IE (Xt ) = , t

COV (Xt , Xt+ ) = ,

t.

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

2nd order Stationarity


A discrete time stochastic process {Xt , t = 0, 1, . . . } is stationary (second order) if its moments of order 2 exist and IE (Xt ) = , t

COV (Xt , Xt+ ) = , For non stationary processes we may have

t.

COV (Xt , Xt+ ) = ,t .

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

2nd order Stationarity

x
0 2 4
0 50 100 Index 150 200

0
0

10

15

20

25

30

50 time

100

150

Figure: (a) Stationary

(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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

example average weekly price for Hass Avocado (10k box)


Precio promedio semanal

Series 1

50
1996

100

150

200

250

300

350

400

1998

2000

2002

2004

2006

2008

Figure: (a) Hass avocado

(b) average weekly prices

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

{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

Stationary Processes ARMA models

{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

Stationary Processes ARMA models

{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

Stationary Processes ARMA models

The ACF points to a SARIMA(p = 0, d = 1, q = 7)(P = 0, D = 1, Q = 1)52 model

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

100 2004

150

200

250

300

400

2005

2006

2007

2008

Figure: Forecasts using a SARIMA(p = 0, d = 1, q = 7)(P = 0, D = 1, Q = 1)52 model

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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)

Under some conditions on the matrix IK 1 z p z p , |z| 1, the model


p

Xt =
i=1

i Xti + 0 + Et ,

is suitable for vectors Xt where each component is a stationary process.

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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)

Under some conditions on the matrix IK 1 z p z p , |z| 1, the model


p

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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 .

for K K dimensional matrices A and {i } and matrices and of dimensions K h and K M

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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

Stationary Processes ARMA models


MAQWNU

1 1990 1995 2000

(1)

IMWNU 15.0

12.5

10.0

7.5

5.0

2.5

1990

1995

1) maquila nominal wage

(2) 2) Manufacturing nominal wage


2000

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

DES 27.5

25.0

22.5

20.0

17.5

15.0 1990 1995 2000

(1)

150

IMYBR

140

130

120

110

100

90 1990 1995 2000

(2)

1) underemployment rate 2) Gross value of production manufacturing

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

Error correction Model


Fit the error correction model from a a VAR(4) for Xt , where X1,t Manufacturing nominal wage X2,t = Maquila nominal wage X3,t Manufacturing gross value of product.

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

Error correction Model


Fit the error correction model from a a VAR(4) for Xt , where X1,t Manufacturing nominal wage X2,t = Maquila nominal wage X3,t Manufacturing gross value of product. As a covariate Zt = underemployment rate is included.

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

Error correction Model


Fit the error correction model from a a VAR(4) for Xt , where X1,t Manufacturing nominal wage X2,t = Maquila nominal wage X3,t Manufacturing gross value of product. As a covariate Zt = underemployment rate is included. Dummies for seasonal eects are included

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

Error correction Model


Fit the error correction model from a a VAR(4) for Xt , where X1,t Manufacturing nominal wage X2,t = Maquila nominal wage X3,t Manufacturing gross value of product. As a covariate Zt = underemployment rate is included. Dummies for seasonal eects are included Assumptions as Normality, no correlation and Heteroskedasticity were tested. The model is ne at signicance level = 0.05.

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

Error correction Model


Fit the error correction model from a a VAR(4) for Xt , where X1,t Manufacturing nominal wage X2,t = Maquila nominal wage X3,t Manufacturing gross value of product. As a covariate Zt = underemployment rate is included. Dummies for seasonal eects are included Assumptions as Normality, no correlation and Heteroskedasticity were tested. The model is ne at signicance level = 0.05. R 2 = 0.93.

Alberto Contreras Cristn, Julio Lpez-Gallardo, Armando Snchez, Miguel some data from the Mexican Economy with Time Ser a o a Studying Chong

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Stationary Processes ARMA models

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

Das könnte Ihnen auch gefallen