time series analysis - lecture 2 a general forecasting principle set up probability models for which...

22
Time series analysis - le cture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate the unknown parameters in that expression Use estimated autocorrelations to select a suitable model class ,.. , , | ( ˆ 3 2 1 t t t t t Y Y Y Y E Y

Post on 19-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

A general forecasting principle

Set up probability models for which we can derive analytical expressions for

and estimate the unknown parameters in that expression

Use estimated autocorrelations to select a suitable model class

,...),,|(ˆ321 ttttt YYYYEY

Page 2: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The first order autoregressive model: AR(1)

...,2,1,),(

1

)()(

1)(

11 where,

2

1

kYYCorr

VarYVar

cYE

YcY

ktkt

tt

t

ttt

The autocorrelation tails off exponentially

Page 3: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Datasets simulated by using a random number

generator and first order autoregressive models

-3

-2

-1

0

1

2

3

1 13 25 37 49 61 73 85 97 109

AR(1)

-8-6-4-20246

1 13 25 37 49 61 73 85 97 109

AR(1)

= 0.2 = 0.9

Page 4: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The first order autoregressive model

- prediction

...,2,1,ˆ

11 where,1

kYY

YY

tk

kt

ttt

Page 5: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Weekly SEK/EUR exchange rate Jan 2004 - Oct 2007

8.9

9

9.1

9.2

9.3

9.4

9.5

9.6

9.7

02/01/2004 01/01/2005 01/01/2006 01/01/2007 01/01/2008

SE

K/E

UR

exc

han

ge

rate

2018161412108642

1.00.80.60.40.20.0

-0.2-0.4-0.6-0.8-1.0

Lag

Auto

corr

ela

tion

Page 6: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Daily SEK/EUR exchange rate Jan 2004 - Oct 2007

757065605550454035302520151051

1.00.80.60.40.20.0

-0.2-0.4-0.6-0.8-1.0

LagAuto

corr

ela

tion

8.8

8.99

9.19.2

9.39.4

9.59.6

9.7

02/01/2004 01/01/2005 01/01/2006 01/01/2007 01/01/2008

SE

K/E

UR

ex

ch

an

ge

ra

te

Page 7: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

No. registered cars

0

50000

100000

150000

200000

250000

300000

350000

400000

1970 1980 1990 2000 2010

No

. reg

iste

red

car

s

10987654321

1.00.80.60.40.20.0

-0.2-0.4-0.6-0.8-1.0

Lag

Auto

corr

ela

tion

Page 8: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Weekly SEK/EUR exchange rate Jan 2004 - Oct 2007

AR(1) model

200180160140120100806040201

9.6

9.5

9.4

9.3

9.2

9.1

9.0

8.9

Time

SEK

/EU

R

Time Series Plot for SEK/ EUR(with forecasts and their 95% confidence limits)

Final Estimates of Parameters

Type Coef SE Coef T P

AR 1 0.9537 0.0218 43.84 0.000

Constant 0.426548 0.002833 150.56 0.000

Mean 9.21262 0.06119

Page 9: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Daily SEK/EUR exchange rate Jan 2004 - Oct 2007

AR(1) model

Final Estimates of Parameters

Type Coef SE Coef T P

AR 1 0.9835 0.0061 161.78 0.000

Constant 0.151965 0.000800 189.86 0.000

Mean 9.21316 0.04853

9008007006005004003002001001

9.7

9.6

9.5

9.4

9.3

9.2

9.1

9.0

8.9

Time

SEK

/EU

RO

WARNING *

Back forecasts

not dying out

rapidly

Page 10: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The general auto-regressive model: AR(p)

{Yt} is said to form an AR(p) sequence if

where the error terms t are independent

and N(0;)

,...11 tptptt YYY

Page 11: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The backshift operator B

The backshift operator B is defined by the relation

It follows that

and we can write the AR(p) model:

1 tt YBY

)...1(... 111 ttp

pptptt YBBYYY

...,2,1, kYYB kttk

Page 12: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The characteristic equation of an

AR(p) sequence

The equation

is called the characteristic equation of an AR(p) sequence

If the roots of this equation are all outside the unit circle, then the AR(p) sequence is stationary

It returns repeatedly to zero, and the autocorrelations tail off with increasing time lags

0...1 1 pp xx

Page 13: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Stationarity of an

AR(p) sequence

p=1Characteristic equation:

The root is outside the unit circle if

p=2Characteristic equation:

The roots of this equation are

all outside the unit circle if:

01 1 x

01 221 xx

11 1

11

1

1

2

12

21

Page 14: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The moving average model: MA(q)

{Yt} is said to form an MA(q) sequence if

where the error terms t are independent

and N(0;)

,...11 qtqtttY

Page 15: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The general auto-regressive-moving-average

model ARMA(p,q)

{Yt} is said to form an ARMA(p,q) sequence if

where the error terms t are independent

and N(0;)

,...... 1111 qtqttptptt YYY

tq

qtp

p BBYBB )...1()...1( 11

Page 16: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Typical auto-correlation functions of

ARMA(p,q) sequences

AR(p): Auto-correlations tail off gradually with increasing time-lags

MA(q): Auto-correlations are zero for time lags greater than q

ARMA(p,q): Auto-correlations tail off gradually with time-lags greater than q

Page 17: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Partial auto-correlation

The partial auto-correlation between Yt and Yt+m represents the remaining correlation after Yt+1, …, Yt+m-1 have been fixed

t t+m

Page 18: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Typical partial auto-correlation functions of

ARMA(p,q) sequences

AR(p): Partial auto-correlations are zero for time lags greater than p

MA(q): Partial auto-correlations tail off gradually with increasing time-lags

ARMA(p,q): Partial auto-correlations tail off gradually with time-lags greater than p

Page 19: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Consumer price index and its first order differences

0

50

100

150

200

250

300

1980 1985 1990 1995 2000 2005 2010Co

nsu

mer

pri

ce in

dex

(19

80=

100) Consumer_price_index

-4

-2

0

2

4

6

8

1980 1985 1990 1995 2000 2005 2010F

irst

ord

er d

iffe

ren

ces

of

con

sum

er p

rice

ind

ex (

1980

=10

0)

Diff_Consumer_price

Page 20: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Consumer price index - first order differences

10987654321

1.00.80.60.40.20.0

-0.2-0.4-0.6-0.8-1.0

LagAuto

corr

ela

tion

-4

-2

0

2

4

6

8

1980 1985 1990 1995 2000 2005 2010

Fir

st o

rder

dif

fere

nce

s o

f co

nsu

mer

pri

ce in

dex

(19

80=

100)

Diff_Consumer_price

Page 21: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

Consumer price index – predictions using an AR(1)

model fitted to first order differences of the original data

300250200150100501

300

250

200

150

100

Time

Consu

mer_

pri

ce_in

dex

Final Estimates of Parameters

Type Coef SE Coef T P

AR 1 0.1701 0.0561 3.03 0.003

Constant 0.49788 0.06307 7.89 0.000

Differencing: 1 regular difference

Number of observations: Original series 312, after differencing 311

Residuals: SS = 382.264 MS = 1.237

Page 22: Time series analysis - lecture 2 A general forecasting principle Set up probability models for which we can derive analytical expressions for and estimate

Time series analysis - lecture 2

The first order integrated autoregressive model: ARI(1)

11 where,1

1

ttt

ttt

wcw

YYw