introduction to time series analysis of macroeconomic- and...

53
Introduction Introduction to Time Series Analysis of Macroeconomic- and Financial-Data Felix Pretis Programme for Economic Modelling Oxford Martin School, University of Oxford Lecture 3: Forecasting and Autoregressive Distributed Lag Models Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 1 / 52

Upload: others

Post on 19-Jun-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Introduction

Introduction to Time Series Analysis ofMacroeconomic- and Financial-Data

Felix Pretis

Programme for Economic ModellingOxford Martin School, University of Oxford

Lecture 3: Forecasting and AutoregressiveDistributed Lag Models

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 1 / 52

Page 2: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Re-Cap

Yesterday...

Model mis-specification: Diagnostics1 Identical distribution:

Is εt ∼ (0,σ2)?Mean must be zero (if constant included), but variance can change.Heteroskedasticity: V [εt] = σ

2t.

2 Independent distribution:Is Corr [εs, εt] = E [εsεt] = 0, for all s 6= t? If not,autocorrelation.Variance not autocorrelated (ARCH)

3 Normal distribution:Is εt ∼ N0,σ2?Residuals may have very different distribution.

4 Functional Form:Model specification test (RESET)

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 2 / 52

Page 3: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Today

Time series =⇒ dependence over time!

1 Auto-regressive models2 Forecasting3 More variables and their lags: auto-regressive distributed lag

models

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 3 / 52

Page 4: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Autoregressive Model

Autoregressive model has three elements:(1) Where Yt was the last time period.(2) The unexpected event εt.(3) Constant term allowing mean of Yt to be non-zero.

Yt = α0︸︷︷︸(3)

+ α1Yt−1︸ ︷︷ ︸(1)

+ εt︸︷︷︸(2)

, εt ∼ N0,σ2. (1)

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 4 / 52

Page 5: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

AR(1) model allows us to determine many things about theory:α1: How quickly equilibrium re-established.α0 and α1: Whether equilibrium is zero or otherwise.σ2: How much variation there is in Yt around equilibrium.

How big are the unexpected events?

What is equilibrium value? Again expectations:

EYt = α0 + α1EYt−1. (2)

Since EYt = EYt−1 we find that µY = EY = α0/(1− α1).We define µY to be the equilibrium value, or unconditional meanof Yt.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 5 / 52

Page 6: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Example: GBP - Yen Spot Exch. Rate

Yen_GBP_X

1975 1980 1985 1990 1995 2000 2005 2010

200

400

600

Yen_GBP_X

ACF-Yen_GBP_X PACF-Yen_GBP_X

0 5 10 15 20

0

1ACF-Yen_GBP_X PACF-Yen_GBP_X

Yen-GBP Spot Rate, Jan 1975 - Dec 2013Source: Bank of England

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 6 / 52

Page 7: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

AR(1) Model (up to Dec. 2012):

Yen-GBP-X = 0.9868(0.00287)

Yen-GBP-Xt−1 + 2.258(0.854)

Yen_GBP_X Fitted

1975 1980 1985 1990 1995 2000 2005 2010

250

500

750

161.29

Yen_GBP_X Fitted

r:Yen_GBP_X (scaled)

1975 1980 1985 1990 1995 2000 2005 2010

-2.5

0.0

2.5

5.0r:Yen_GBP_X (scaled)

LR-mean = µY = EY = α0/(1− α1) = 2.258/1− 0.9868 = 161.29Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 7 / 52

Page 8: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Today

1 Forecasting2 More variables and their lags: auto-regressive distributed lag

models

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 8 / 52

Page 9: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Forecasting

Forecasting is now possible: We model today based onyesterday.

So we can forecast tomorrow based on today.

Notation for forecast made at time T of variable Yt at YT+1:YT+1|T .Forecast using our model next period value after sample:

E.g. Tomorrow’s closing Toyota price given today’s closing price.If forecast is accurate, can make money: Buy or sell! Long or short!

YT+1|T = α0 + α1YT . (3)

But: Forecast based on known events today, at time T .Anything can happen before T + 1: Future can be unpredictable!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 9 / 52

Page 10: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Can run AR(1) model on data and forecast today’s closing rate.

AR(1) estimated model is:

Yen-GBP-X = 0.9868(0.00287)

Yen-GBP-Xt−1 + 2.258(0.854)

Forecast of YT+1 is YT+1|T = 0.986YT .So 98.6% of value today: Not moving much!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 10 / 52

Page 11: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Forecasting Exchange Rate: h-step

YT+1 is YT+1|T = 0.986YT

1-step Forecasts Yen_GBP_X

2012 2013 2014

120

130

140

150

160

17012 Months, 1-Month ahead (1-Step)

1-step Forecasts Yen_GBP_X

Before thick green line: Training period forecastsAfter thick green line YT+1|T = 0.986YT , actual forecast.Green bar after thick green line is 95% forecast interval:

95% of the time actual value will lie within these bounds*.

...up to Jan. 2013 (data available). What if further? (Out of Sample)Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 11 / 52

Page 12: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

With AR(1) model we can forecast more periods ahead:Two periods ahead: YT+2|T+1 = YT+1.But YT+1 needs forecasting: YT+1|T = αYT . SoYT+2|T+1 = αYT+1|T = α2YT .

Forecasts Yen_GBP_X

2012 2013 2014 2015

100

150

200

Forecasts Yen_GBP_X

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 12 / 52

Page 13: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Dynamic Forecasts

Forecasts Yen_GBP_X

2000 2005 2010 2015

100

150

200

250

300

48-Months

LR Mean: 161.29

Forecasts Yen_GBP_X

Forecast tends towards long-term mean of 161.29Equilibrium correction-type model. Simple autoregressiveequilibrium also.

The further ahead we forecast, the less certain we are: Biggerbands.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 13 / 52

Page 14: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Another Example: Inflation

Forecasting UK and Japanese Inflation

DLP_Japan

1980 1990 2000 2010-0.01

0.00

0.01

0.02

DLP_Japan DLP_UK

1980 1990 2000 2010

0.00

0.02

0.04 DLP_UK

ACF-DLP_Japan PACF-DLP_Japan

0 5

-0.5

0.0

0.5

1.0ACF-DLP_Japan PACF-DLP_Japan ACF-DLP_UK PACF-DLP_UK

0 5

-0.5

0.0

0.5

1.0ACF-DLP_UK PACF-DLP_UK

∆Log(CPI) for Japan, UK (Source: OECD)Monthly: more lags needed!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 14 / 52

Page 15: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Note

Properties of Logs: Why do we use ∆log(CPI)?

Note: r ≈ ln(1+ r) for small r, using r = xt−xt−1

xt−1(percentage

change):

xt − xt−1

xt−1≈ ln

(1+

xt − xt−1

xt−1

)≈ ln

(1+

xt

xt−1− 1

)≈ ln

(xt

xt−1

)= ln(xt) − ln(xt−1) = ∆ln(xt)

∆log(CPIt) ≈ Percentage change in prices = Inflation/Deflation

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 15 / 52

Page 16: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Forecasts 2012-2013: 6-lags

1-step Forecasts DLP_Japan

2012 2013 2014

0.00

0.01

1-Step

Japan

1-step Forecasts DLP_Japan Forecasts DLP_Japan

2012 2013 2014

0.00

0.01

Dynamic

Japan

Forecasts DLP_Japan

1-step Forecasts DLP_UK

2012 2013 2014

-0.01

0.00

0.01

1-Step

UK

1-step Forecasts DLP_UK Forecasts DLP_UK

2012 2013 2014

0.00

0.01

Dynamic

UK

Forecasts DLP_UK

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 16 / 52

Page 17: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Evaluating Forecasts

How do we measure forecast performance?Potential Measures

Errors: eT+1 =(yT+1|T − yT+1

), eT+2 =

(yT+2|T+1 − yT+2

)...

Mean Error (over K-forecasts): 1/K∑Ki=1 eT+i

Mean Squared Error: 1/K∑Ki=1 e

2T+i

Root Mean Squared Error:√

1/K∑Ki=1 e

2T+i

→ One of many potential measures

1-step Forecasts Yen_GBP_X

2012 2013 2014

125

150

175

1-step Forecasts Yen_GBP_X Forecast Error

2012 2013 2014

-5

0

Forecast Error Squared Forecast Error

2012 2013 2014

25

50

Squared Forecast Error

RMSE = 4.4150Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 17 / 52

Page 18: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

More forecasting!

Japanese Exports: 1979:8 – 2008:8

Estimate AR(1) Model

h-step forecasts

dynamic forecasts

JapanExports

1980 1985 1990 1995 2000 2005

2.5e9

5.0e9

7.5e9 JapanExports

Seasonal effects, data in levels

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 18 / 52

Page 19: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

1 Take logs2 Take first differences of logs (≈ percentage changes)

LJapanExports

1980 1985 1990 1995 2000 2005

21.5

22.0

22.5

LJapanExports

DLJapanExports

1980 1985 1990 1995 2000 2005

-0.25

0.00

0.25DLJapanExports

→ Seasonal effects, noisy!Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 19 / 52

Page 20: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Year-to-Year differences∆12Yt

D12LJapanExports

1980 1985 1990 1995 2000 2005

-0.2

-0.1

0.0

0.1

0.2

0.3

0.4 D12LJapanExports

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 20 / 52

Page 21: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Estimate AR(1) Model

1980:2 – 2008:8Model:

∆12Yt = α∆12Yt−1 + µ

Estimated Model:

D12LJapanExports = 0.865(0.0258)

D12LJapanExportst−1 + 0.00544(0.0028)

D12LJapanExports Fitted

1980 1985 1990 1995 2000 2005

0.00

0.25

0.50D12LJapanExports Fitted

r:D12LJapanExports (scaled)

1980 1985 1990 1995 2000 2005

-2.5

0.0

2.5 r:D12LJapanExports (scaled)

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 21 / 52

Page 22: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Dynamic Forecasts

Re-write the Model in deviations from equilibrium:

yt = ρyt−1 + µ

yt = ρyt−1 +1− ρ

1− ρµ

yt = ρyt−1 +µ

1− ρ︸ ︷︷ ︸= LR Mean =µY

(1− ρ)

yt = ρyt−1 + µY(1− ρ)

yt − µY = ρ (yt−1 − µY)

=⇒ future deviations from LR mean = past deviation from LR meanweighted by auto-regressive coefficient!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 22 / 52

Page 23: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Dynamic Forecasts

Model:yt − µY = ρ (yt−1 − µY)

Forecasts:

yT+1|T − µY = ρ (yT − µY)

yT+2|T − µY = ρ(yT+1|T − µY

)...

K-Periods ahead: (4)

yT+K|T − µY = ρK (yT − µY)

=⇒ Forecasts correct towards in-sample estimated equilibrium µY !

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 23 / 52

Page 24: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Japanese Exports

Estimated Model:

D12LJapanExports = 0.865(0.0258)

D12LJapanExportst−1 + 0.00544(0.0028)

LR Model Mean = 0.00541−0.865 = 0.04

D12LJapanExports Fitted

1980 1985 1990 1995 2000 2005

0.00

0.25

0.50D12LJapanExports Fitted

r:D12LJapanExports (scaled)

1980 1985 1990 1995 2000 2005

-2.5

0.0

2.5 r:D12LJapanExports (scaled)

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 24 / 52

Page 25: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Dynamic Forecasts

Japanese Exports – Dynamic Forecasts

Forecasts D12LJapanExports

2008 2009

-0.2

-0.1

0.0

0.1

0.2

Forecasts D12LJapanExports

What can go wrong?

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 25 / 52

Page 26: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Dynamic Forecasts vs. Actual

Forecasts D12LJapanExports

2008 2009 2010

-0.6

-0.4

-0.2

0.0

0.2

0.4Forecasts D12LJapanExports

Structural Break!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 26 / 52

Page 27: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

1-step Forecast vs. Actual

Does 1-step do any better?

1-step Forecasts D12LJapanExports

2008 2009 2010

-0.50

-0.25

0.00

0.25

1-step Forecasts D12LJapanExports

Systematic mistakes!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 27 / 52

Page 28: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Structural Breaks

Unexpected change wreak havoc with statistical inference!

Structural break: change in parameter (e.g. µY → µ ′Y)

Forecasts correct towards old equilibrium!

More on structural breaks tomorrow!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 28 / 52

Page 29: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Structural Break

Forecast

Systematic mistakes!Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 29 / 52

Page 30: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

It happens to the best...

GDP growth projection & CPI inflation projection

Source: Bank of England

Prerequisite for a forward-looking macroeconomic policy.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 30 / 52

Page 31: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

It happens to the best...

GDP growth projection & CPI inflation projection

Source: Bank of England

Prerequisite for a forward-looking macroeconomic policy.A view of the future is fundamental to economic planning:

unavoidable – but hazardous!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 30 / 52

Page 32: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Forecasting

Forecasting very difficult — especially if it’s about the future!Forecasting easy to do practically once you understand dynamicmodels:

But very difficult to do effectively!

1 We may not have good model:We may need more lags and/or more variables.

2 Even with good model, structure of economy can change:E.g. Forecasting Japanese interest rates on pre-1995 data.

Joke: economic forecasters were invented to make weatherforecasters look good. . .

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 31 / 52

Page 33: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

1 Forecasting2 More variables and their lags: auto-regressive distributed lag

models

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 32 / 52

Page 34: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Autoregressive Distributed Lag Model

We need to include all variables that matter: And all lags of thosevariables.Other variables matter: E.g. Price of orange juice, timedependence and dependence on production conditions!But impact of extra variables not restricted to one period:

Distributed lag: Effect of Xt on Yt spread over more than onetime period.E.g. Effect of advertising (Xt) on sales (Yt):Yt = α0 + β0Xt + β1Xt−1 + εt.Increase in advertising yesterday will still affect sales today.

If we include also Yt−1 then we have autoregressive distributedlag (ADL) model:

Yt = α0 + α1Yt−1 + β0Xt + β1Xt−1 + εt.

Extremely common model in time-series econometrics.Very flexible and very general. Can have more lags (p) or morevariables.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 33 / 52

Page 35: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Example: Orange Juice Concentrate

Price of Orange Juice:Measure: Producer Price Index (≈ Price) (PPI inflation adjusted)

Prices Sticky (time dependence)

Freezing Days (FDD)Lag effect on production

PPIOJ

1950 1960 1970 1980 1990 2000

50

100

150

PPI Orange JuicePPIOJ FDD

1950 1960 1970 1980 1990 2000

10

20

30

Freezing Degree DaysFDD

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 34 / 52

Page 36: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Percentage Change in Price

Log transform PPI of Orange Juice Concentrate

PPIOJ

1960 1980 2000

50

100

150

Level

PPIOJ LPPIOJ

1960 1980 2000

4

5

Log

LPPIOJ DLPPIOJ

1960 1980 2000

-0.25

0.00

0.25

∆Log

DLPPIOJ

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 35 / 52

Page 37: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

ADL Model for OJ Price

Model:

∆log(PPIOJ)t = α1∆log(PPIOJ)t−1+α0+β0FDDt+β1FDDt−1+εt

Estimated Model:

∆log(PPIOJ)t = 0.101(0.039)

∆log(PPIOJ)t−1 − 0.0023(0.0019)

+ 0.0046(0.00057)

FDDt

+ 0.00087(0.00060)

FDDt−1

D log(PPIOJ) Fitted

1950 1960 1970 1980 1990 2000

-0.25

0.00

0.25

D log(PPIOJ) Fitted Residuals (scaled)

1950 1960 1970 1980 1990 2000

-5

0

5

Residuals (scaled)

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 36 / 52

Page 38: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Modelling Orange Juice

The dataset is: oj.in7The estimation sample is: 1949(8) - 2001(6)

Coefficient Std.Error t-value t-prob Part.Rˆ2DLPPIOJ_1 0.101394 0.03981 2.55 0.0111 0.0104Constant -0.00236329 0.001973 -1.20 0.2315 0.0023FDD 0.00466120 0.0005728 8.14 0.0000 0.0966FDD_1 0.000873394 0.0006026 1.45 0.1477 0.0034

sigma 0.0476113 RSS 1.40317206Rˆ2 0.11383 F(3,619) = 26.5 [0.000]**Adj.Rˆ2 0.109535 log-likelihood 1014.85no. of observations 623 no. of parameters 4mean(DLPPIOJ) 0.00121465 se(DLPPIOJ) 0.0504547When the log-likelihood constant is NOT included:AIC -6.08297 SC -6.05450HQ -6.07191 FPE 0.00228139When the log-likelihood constant is included:AIC -3.24509 SC -3.21662HQ -3.23403 FPE 0.0389650

AR 1-7 test: F(7,612) = 1.0918 [0.3667]ARCH 1-7 test: F(7,609) = 0.40077 [0.9020]Normality test: Chiˆ2(2) = 699.23 [0.0000]**Hetero test: F(6,616) = 4.7662 [0.0001]**Hetero-X test: F(9,613) = 3.9929 [0.0001]**RESET23 test: F(2,617) = 0.28873 [0.7493]

Diagnostics...Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 37 / 52

Page 39: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Economic Theory:Orange trees→ packaging takes timeDynamic effect may be delayed!

Proposal: add more lags.

Specify ADL with 1 autoregressive lag, and 18 lags on weathervariable.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 38 / 52

Page 40: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Effect over time?

Cumulative effect of freezing days

Yt = α1Yt−1 + β1Xt + β2Xt−1 + β3Xt−2 + εt

Effect of Xt:

t : β1 (5)

t+ 1 : α1β1 + β2 (6)

t+ 2 : α21β1 + αβ2 + β3 (7)

... (8)

Model with 18 lags on freezing days, cumulative effect:

Cumulative Impact of FDD

0 5 10 15 20 25 30 35 40

1.5

2.5

Months

Cumulative Impact of FDD

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 39 / 52

Page 41: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

The ADL model changes the equilibrium properties of the data.It may be that a number of variables move together to establishequilibrium.

E.g. Interest rates, inflation and output growth move untilequilibrium reached.

Like Yt, we assume Xt stationary also: HenceE(Xt) = E(Xt−1) = µX.Taking expectation:

E(Yt) = E(α0 + α1Yt−1 + β0Xt + β1Xt−1 + εt)

⇒ µY = α0 + α1µY + β0µX + β1µX.

Rearranging:

µY =α0

1− α1+β0 + β1

1− α1µX. (9)

This is unconditional expectation of Yt. Also called long-runsolution.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 40 / 52

Page 42: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Long Run Solution

Long-run solution: Where our data settle down to.If Xt important for determining Yt then µX determines µY .

Long-run solution is fundamental long-term relationship betweenvariables.

Hence if Xt and Yt in equilibrium then:

Yt =α0

1− α1+β0 + β1

1− α1Xt. (10)

This is a static relationship:Without any unexpected events, economy stays here:Equilibrium.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 41 / 52

Page 43: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

But unexpected events happen: We call these error terms, e.g.:et ∼ N

(0,σ2e

).

Hence we usually observe:

Yt =α0

1− α1+β0 + β1

1− α1Xt + et. (11)

et could be called our equilibrium error: What dislodges us fromequilibrium:

et = Yt −α0

1− α1−β0 + β1

1− α1Xt. (12)

If µY = α0

1−α1+ β0+β1

1−α1µX genuine equilibrium, data will return to

it.

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 42 / 52

Page 44: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Important: We never observe µY = α0

1−α1+ β0+β1

1−α1µX just like in

AR(1) model.But data clearly move around this particular equilibrium level.

Economic theory suggests static relationships between data.E.g. PPP: st = pt − p∗t .

But we need to account for significant lags: Omitted variable bias!

Solution: Model ADL and find long-run solution!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 43 / 52

Page 45: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Example: Consumption

Consumption: Some function of our income.Short-run: When consuming we don’t necessarily think of incomelevel.Long-run: We think of income level and correct consumption ifnecessary.

Japan data: 1980:Q1–2010:Q3.

%Change Consumption %Change Income

1980 1985 1990 1995 2000 2005 2010

-0.025

0.025

%Change Consumption %Change Income

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 44 / 52

Page 46: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Modelling Japanese Consumption

Use ADL(1) model:

Yt = α0 + α1Yt−1 + β0Xt + β1Xt−1 + εt.

Account for time dependence and find long-run solution!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 45 / 52

Page 47: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Estimated Model:

DLCons = − 0.182(0.091)

DLConst−1 + 0.00371(0.000635)

+ 0.595(0.043)

DLInct

+ 0.165(0.067)

DLInct−1

Long-Run Steady-State Solution:

DLConst = 0.003+ 0.64 DLINCt (13)

1% increase in income, 0.65% increase in consumption

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 46 / 52

Page 48: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Is one lag enough?

Assess ACF/PACF and Cross CorrelationCan we know two series related over time?Cross-correlation (CCF) plot can give some idea:

Corr(Yt,Xt−s) =Cov(Yt,Xt−s)√V(Yt)

√V(Xt−s)

. (14)

ACF-DLCons PACF-DLCons

0 10

0

1ACF %Change Consumption

ACF-DLCons PACF-DLCons ACF-DLInc PACF-DLInc

0 10

0

1ACF %Change Income

ACF-DLInc PACF-DLInc

CCF-DLCons x DLInc CCF-DLInc x DLCons

0 10

0.5

1.0Cross Corr. Function: Cons. Income

CCF-DLCons x DLInc CCF-DLInc x DLCons

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 47 / 52

Page 49: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

More lags

4 auto-regressive lags (1 year)allow for 8 lags (2 years) of income effectModel Estimates:

Coefficient Std.Error t-value t-prob Part.RˆDLCons_1 -0.411483 0.1019 -4.04 0.0001 0.140DLCons_2 0.126588 0.1008 1.26 0.2123 0.015DLCons_3 0.217934 0.09541 2.28 0.0245 0.049DLCons_4 -0.00244115 0.09565 -0.0255 0.9797 0.000Constant 0.00210068 0.0007161 2.93 0.0042 0.079DLInc 0.515283 0.04603 11.2 0.0000 0.556DLInc_1 0.203483 0.06941 2.93 0.0042 0.079DLInc_2 -0.0967066 0.07151 -1.35 0.1793 0.018DLInc_3 -0.0506276 0.06769 -0.748 0.4562 0.005DLInc_4 0.0230408 0.06700 0.344 0.7316 0.001DLInc_5 -0.0227044 0.04657 -0.488 0.6269 0.002DLInc_6 0.0756767 0.04620 1.64 0.1046 0.026DLInc_7 0.168906 0.05155 3.28 0.0014 0.097DLInc_8 0.0199842 0.05468 0.365 0.7155 0.001

AR 1-5 test: F(5,95) = 0.90790 [0.4794]ARCH 1-4 test: F(4,106) = 1.4470 [0.2237]Normality test: Chiˆ2(2) = 5.3754 [0.0680]Hetero test: F(26,87) = 0.40456 [0.9947]Hetero-X test: not enough observationsRESET23 test: F(2,98) = 2.3608 [0.0997]

Long run equilibrium: DLConst = 0.002+ 0.78 DLINCtFelix Pretis (Oxford) Time Series Akita Intl. University, 2016 48 / 52

Page 50: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Practical

Computer Lab Session 3:

Forecastingh-stepDynamic

xkcd.com

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 49 / 52

Page 51: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Forecasting Game

Forecasting Car Stock Prices:

load data ”car closing price forecast model.in7”

Plot all the series!

Forecast Ford Closing Price ahead from 1.11.2013 onwards(predicting prices one week ahead, 5-step)

Using different lags and functional forms, build a model with thelowest RMSFE as possible!

5-Step forecasts (one week ahead)

Number of Forecasts: 22

Only lagged variables allowed! (True forecasts)

Make sure end of sample is set to 31.10.2013!

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 50 / 52

Page 52: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

What are your RMSFE values?

See how well your forecast model performs later in the year:

load data: ”car closing price 2.in7”

Using the same model, now forecast from 30.11.2013 onwards

5-step forecasts (one week)

How does your model perform?

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 51 / 52

Page 53: Introduction to Time Series Analysis of Macroeconomic- and ...felixpretis.climateeconometrics.org/wp...FP_Lec_3... · Introduction to Time Series Analysis of Macroeconomic- and Financial-Data

Additional Exercise

Create OxMetrics dataset using ”rgdp growth.xls”:

Forecast Japanese GDP growth from 2007 onwards using anauto-regressive model. What do you observe? Do your forecastsseem reasonable?

Forecast Japanese GDP growth for the next 20 years (hint: usedynamic forecasts), do your forecasts seem reasonable?

Make suggestions for improving this model. What other variablesmight be important?

Felix Pretis (Oxford) Time Series Akita Intl. University, 2016 52 / 52