• Nem Talált Eredményt

Univariate time series analysis II.

N/A
N/A
Protected

Academic year: 2022

Ossza meg "Univariate time series analysis II. "

Copied!
14
0
0

Teljes szövegt

(1)

ECONOMETRICS

Sponsored by a Grant TÁMOP-4.1.2-08/2/A/KMR-2009-0041 Course Material Developed by Department of Economics,

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest

Institute of Economics, Hungarian Academy of Sciences Balassi Kiadó, Budapest

(2)

Authors: Péter Elek, Anikó Bíró Supervised by Péter Elek

June 2010

Week 10

Univariate time series analysis II.

Plan

AR, MA, ARMA and ARIMA processes

Box–Jenkins methodology, estimation and goodness of fit test of ARMA models Forecasting from ARMA models

Material: M 13.4–13.6

AR(1) process

2 2

2 1

2

0

1

0 1 2

2 1

1 / )

Var(

) Var(

) Var(

1 / )

(

repr.) )

(MA(

1

/

: and , stationary is

model then the

1

|

| If

1 1

...

) , 0 (

~ ,

t t

t t

i

i t i t

n

i

i t i n

t n n

t t

t t

t t t

t

X X

X X E X

X X X

IN X

X

(3)

ACF, PACF in AR(1) models

AR(p) process

1 k if , 0

1 k if , 1

) ,

cov(

) ,

cov(

2

1 1

k

k k

k k

k k

t t t

k t t

k

X X X X

t p

t p t

p p

t p p t

t k k t

t p t p t

t t

L L

L

L L

L X

x x

X L L

L

X L X

X X

X c

X

1 2

1

1 1 2

2 1

t i

1 1 p i

2 2 1

2 2 1 1

1 ...

1 1

...

1

and stationary is

X then 1,

|

| satisfy 0

...

of roots all

If

. ...

1

operator, lag

the using and

0 c Assuming

...

(4)

Properties of stationary AR(p) processes

Example: AR(1) process

Xt = 0,7Xt–1+ t

(ACF is easy to calculate)

. if

0 : PACF

recursion :

), (

equations of

system :

...

...

, ...

cov ,

cov

equations Walker

- Yule : ACF

...

1 /

k - k 2

2 1 1

2 2 1 1

1 1 2 1

p k p k

p k

X X

X c

X X

c X E

k

p k p k

k k

p k p k

k

k t t p t p t

k t t k

p t

-3 -2 -1 0 1 2 3 4

25 50 75 100

-3 -2 -1 0 1 2 3 4

25 50 75 100

(5)

Example: AR(2) process

Xt = 0,4Xt–1 + 0,5Xt–2 + t

MA(1) process

-3 -2 -1 0 1 2 3 4 5

25 50 75 100

-3 -2 -1 0 1 2 3 4 5

25 50 75 100

. every for

stationary :

X

0 to decays :

1 if 0

1 /

1 if 0

1 Var

t

2 1

2 1

2 2

0

1

k k k

t t

t t

t

k k X

c X

E

c

X

(6)

MA(q) process

Example: MA(1) process

Xt = t + 0,7 t–1

(ACF is easy to calculate)

i t

0 0 2

2 2

1 2

0

1 1

every for

stationary :

X

zero to

decays :

/

. if

0,

0 if ,

...

1 Var

...

k

k k

k q

i

k i i k

q t

t

q t q t

t t

q k

q k X

c X

E c X

-3 -2 -1 0 1 2 3 4

25 50 75 100

-3 -2 -1 0 1 2 3 4

25 50 75 100

(7)

ARMA(p,q) process

Xt = c + α1Xt–1 +…+ αpXt–p+ t + β1 t–1 +…+ βq t–q

Stationary if its AR(p) component is stationary (all roots of the characteristic equation…)

Neither ACF nor PACF is 0, but both tend to zero at an exponential rate.

Remark: ACF PACF

AR(p) decays to 0 0 for k>q

MA(q) 0 for k>q decays to 0

ARIMA(p,d,q) process

Xt is an ARIMA(p,1,q) process if Xt is a stationary ARMA(p,q) process.

Similarly, Xt is an ARIMA(p,d,q) process if Xt is an ARIMA(p,d–1,q) process.

Order of integration of ARIMA(p,d,q) is I(d).

Examples:

ARIMA(0,1,0): Xt – Xt-1 = t is the random walk.

ARIMA(1,1,0): Xt – Xt–1 = (Xt–1 – Xt–2) + t, where | |<1.

So Xt = (1 + )Xt–1 – Xt–2 + t is a nonstationary AR(2) process.

(8)

Example: ARMA(1,1) process

Estimation of ACF

Estimation:

Only makes sense in the stationary case, and in this case it is consistent (i.e. for large T it estimates k with a small variance).

-6 -4 -2 0 2 4 6

25 50 75 100

-6 -4 -2 0 2 4 6

25 50 75 100

T

t t k

T

t

k t t

k

X X

X X

X X

1

2

ˆ

1

(9)

Box-Jenkins methodology

Taking differences

The series is differentiated until it becomes stationary Identification

Conjecture of the orders p, q of the ARMA model based on the ACF Estimation

Examining the goodness of fit

Estimation of ARMA models

Simple in the case of AR models

OLS (minimising the sum of squares of the estimated innovations ( t)) Consistent and asymptotically normal in the stationary case

In the case of MA or ARMA models Full maximum likelihood or Searching methods

Choosing the starting innovations as zero, the subsequent innovations can be calculated as a function of the parameters, and their sum of squares can be minimised

(10)

Model selection criteria in ARMA models

These criteria control for the fact that using more parameters in the model may only apparently give a better fit

Minimising a criterion yields to the optimal size of the model.

Examples:

Akaike information criterion

AIC = n·log(RSS/(n – s)) + 2s Bayes (Schwartz) information criterion

BIC = n·log(RSS/(n – s)) + s · logn Where

s: number of estimated parameters RSS: sum of squares of innovations n: sample size

Testing autocorrelation in the residuals

sample) large

, H (under

~

... ˆ ˆ

ˆ ˆ

s innovation on the

regression :

test - Godfrey -

Breusch

sample) large

, H (under

ˆ ~ 2

: test - Box - Ljung

0

residuals the

of ation autocorrel k

lag :

0 2

2

2 2 1 1

0 2

1 2 2

1 0

m

t m t m t

t t

s m m

k k LB

m k

NR

u b

b b

n-k n r

n Q

r ...

r

: r

H

r

(11)

Example: white noise test for S&P logarithmic returns

White noise test (cont.)

low, perhaps significant autocorrelation

but: one should be careful when drawing conclusions because of heteroscedasticity (changing variance)

0 200 400 600 800 1000 1200 1400 1600

1000 2000 3000 4000 5000

-.25 -.20 -.15 -.10 -.05 .00 .05 .10

1000 2000 3000 4000 5000

0 200 400 600 800 1000 1200 1400 1600

1000 2000 3000 4000 5000

-.25 -.20 -.15 -.10 -.05 .00 .05 .10

1000 2000 3000 4000 5000

(12)

Forecasting from ARIMA models

Types of forecasts and evaluation of their performance

Forecasts In sample Out of sample

Performance evaluation: root mean squared error (RMSE), mean absolute error (MAE)

Estimation on interval [1,T], evaluation on interval [T+1,T+m]

t t

t

t t t

t t t

t t t

t t

t t

t t t

t t t

t t t

t t t

t t

t t

t t

X X

I X

X E

I X E X

X X

I X

X E

I X E X

X X I

X X

X

ˆ ˆ ˆ ˆ

ˆ ˆ

| ˆ |

ˆ ˆ ˆ ˆ

ˆ ˆ ˆ

| ˆ |

,...) ,

( in t set n informatio

g Forecastin

ˆ ˆ ˆ ˆ

ˆ ˆ

ˆ ˆ

ˆ 0 , ˆ 0

s innovation Estimated

2 2

1 1

2 1 1 2 2

1 1 2

1

1 2 1

1 2 1

1 2 1

1 1 2 1

1 1

1

2 2 1 1 2 2 1 1 1 0

m X X RMSE

m T

T t

t t 1

ˆ 2

m X X MAE

m T

T t

t t 1

ˆ |

|

(13)

Seminar

Univariate time series II.

Exercises I

Simulation of AR(1), MA(1), AR(2) and MA(2) time series Graphical representation of the ACF and PACF

Determination of the ACF and PACF by the Yule-Walker equations

Evaluation of the stationarity of the AR(2) model by the roots of the characteristic equation

Exercises: series of company

bond data I. Evaluation of stationarity by visual inspection of the ACF

Estimation of ARMA models on a subsample Goodness of fit test and model selection

Significance of parameters

Uncorrelatedness of residuals (Ljung–Box and Breusch–Godfrey-tests) Model selection based on AIC and BIC

(14)

Exercises: series of company bond data II

Static (multi-period) forecast based on the best performing model Dynamic (one-period) forecast

Comparison of its RMSE with that of the naive forecast Graphical comparison of the forecasts to the observed data

Hivatkozások

KAPCSOLÓDÓ DOKUMENTUMOK

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest?. Institute of Economics, Hungarian Academy of Sciences

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest.. Institute of Economics, Hungarian Academy of Sciences

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest.. Institute of Economics, Hungarian Academy of Sciences

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest?. Institute of Economics, Hungarian Academy of Sciences

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest?. Institute of Economics, Hungarian Academy of Sciences

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest.. Institute of Economics, Hungarian Academy of

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest.. Institute of Economics, Hungarian Academy of

Faculty of Social Sciences, Eötvös Loránd University Budapest (ELTE) Department of Economics, Eötvös Loránd University Budapest.. Institute of Economics, Hungarian Academy of