ECON/FIN 250: Forecasting in Finance and Economics: Section 8: Forecast Examples: Part 1

Similar documents
ECON/FIN 250: Forecasting in Finance and Economics: Section 7: Unit Roots & Dickey-Fuller Tests

ECON/FIN 250: Forecasting in Finance and Economics: Section 6: Standard Univariate Models

STAT Financial Time Series

Autoregressive Moving Average (ARMA) Models and their Practical Applications

ECON/FIN 250: Forecasting in Finance and Economics: Section 3.2 Filtering Time Series

Advanced Econometrics

Forecasting using R. Rob J Hyndman. 2.4 Non-seasonal ARIMA models. Forecasting using R 1

Univariate linear models

Midterm Suggested Solutions

ARIMA Modelling and Forecasting

Problem Set 2 Solution Sketches Time Series Analysis Spring 2010

Postestimation commands predict estat Remarks and examples Stored results Methods and formulas

Ch 8. MODEL DIAGNOSTICS. Time Series Analysis

Univariate Time Series Analysis; ARIMA Models

Univariate ARIMA Models

Empirical Market Microstructure Analysis (EMMA)

4. MA(2) +drift: y t = µ + ɛ t + θ 1 ɛ t 1 + θ 2 ɛ t 2. Mean: where θ(l) = 1 + θ 1 L + θ 2 L 2. Therefore,

Chapter 8: Model Diagnostics

Econ 623 Econometrics II Topic 2: Stationary Time Series

Ch 6. Model Specification. Time Series Analysis

Dynamic Time Series Regression: A Panacea for Spurious Correlations

Estimating AR/MA models

FE570 Financial Markets and Trading. Stevens Institute of Technology

Lecture 5: Estimation of time series

Econometrics I: Univariate Time Series Econometrics (1)

Modelling using ARMA processes

INTRODUCTION TO TIME SERIES ANALYSIS. The Simple Moving Average Model

Lab: Box-Jenkins Methodology - US Wholesale Price Indicator

Comment about AR spectral estimation Usually an estimate is produced by computing the AR theoretical spectrum at (ˆφ, ˆσ 2 ). With our Monte Carlo

Part 1. Multiple Choice (50 questions, 1 point each) Part 2. Problems/Short Answer (10 questions, 5 points each)

Review Session: Econometrics - CLEFIN (20192)

ECON/FIN 250: Forecasting in Finance and Economics: Section 4.1 Forecasting Fundamentals

TMA4285 December 2015 Time series models, solution.

Circle a single answer for each multiple choice question. Your choice should be made clearly.

Vector autoregressions, VAR

at least 50 and preferably 100 observations should be available to build a proper model

Problem Set 2: Box-Jenkins methodology

Prof. Dr. Roland Füss Lecture Series in Applied Econometrics Summer Term Introduction to Time Series Analysis

Lecture on ARMA model

Chapter 9: Forecasting

Circle the single best answer for each multiple choice question. Your choice should be made clearly.

Econometrics II Heij et al. Chapter 7.1

Measures of Fit from AR(p)

2. An Introduction to Moving Average Models and ARMA Models

Trending Models in the Data

Lecture 10: Panel Data

MAT3379 (Winter 2016)

Lecture 1: Stationary Time Series Analysis

A lecture on time series

Akaike criterion: Kullback-Leibler discrepancy

AR, MA and ARMA models

APPLIED ECONOMETRIC TIME SERIES 4TH EDITION

AR(p) + I(d) + MA(q) = ARIMA(p, d, q)

Lecture 1: Stationary Time Series Analysis

Auto correlation 2. Note: In general we can have AR(p) errors which implies p lagged terms in the error structure, i.e.,

Ordinary Least Squares Regression

Lecture 6a: Unit Root and ARIMA Models

Lecture Notes of Bus (Spring 2017) Analysis of Financial Time Series Ruey S. Tsay

Stationary Stochastic Time Series Models

Author: Yesuf M. Awel 1c. Affiliation: 1 PhD, Economist-Consultant; P.O Box , Addis Ababa, Ethiopia. c.

Introduction to ARMA and GARCH processes

Exercises - Time series analysis

Unit Root and Cointegration

Multivariate Time Series Analysis and Its Applications [Tsay (2005), chapter 8]

Econometrics. Week 11. Fall Institute of Economic Studies Faculty of Social Sciences Charles University in Prague

University of Oxford. Statistical Methods Autocorrelation. Identification and Estimation

Applied time-series analysis

Estimation and application of best ARIMA model for forecasting the uranium price.

Section 2 NABE ASTEF 65

Introduction to Time Series Analysis. Lecture 11.

Unit root problem, solution of difference equations Simple deterministic model, question of unit root

Lecture note 2 considered the statistical analysis of regression models for time

COMPUTER SESSION 3: ESTIMATION AND FORECASTING.

Economics 618B: Time Series Analysis Department of Economics State University of New York at Binghamton

Module 3. Descriptive Time Series Statistics and Introduction to Time Series Models

Ross Bettinger, Analytical Consultant, Seattle, WA

MEI Exam Review. June 7, 2002

distributed approximately according to white noise. Likewise, for general ARMA(p,q), the residuals can be expressed as

We will only present the general ideas on how to obtain. follow closely the AR(1) and AR(2) cases presented before.

A time series is called strictly stationary if the joint distribution of every collection (Y t

STAT 436 / Lecture 16: Key

5 Autoregressive-Moving-Average Modeling

10) Time series econometrics

Linear models. Chapter Overview. Linear process: A process {X n } is a linear process if it has the representation.

ARIMA Models. Jamie Monogan. January 25, University of Georgia. Jamie Monogan (UGA) ARIMA Models January 25, / 38

Linear models and their mathematical foundations: Simple linear regression

ARIMA Models. Jamie Monogan. January 16, University of Georgia. Jamie Monogan (UGA) ARIMA Models January 16, / 27

Topic 4 Unit Roots. Gerald P. Dwyer. February Clemson University

Empirical Approach to Modelling and Forecasting Inflation in Ghana

Box-Jenkins ARIMA Advanced Time Series

EASTERN MEDITERRANEAN UNIVERSITY ECON 604, FALL 2007 DEPARTMENT OF ECONOMICS MEHMET BALCILAR ARIMA MODELS: IDENTIFICATION

Econometrics. 9) Heteroscedasticity and autocorrelation

7 Introduction to Time Series Time Series vs. Cross-Sectional Data Detrending Time Series... 15

ECON 4160, Spring term Lecture 12

Non-Stationary Time Series and Unit Root Testing

6.3 Forecasting ARMA processes

BIO5312 Biostatistics Lecture 13: Maximum Likelihood Estimation

FORECASTING SUGARCANE PRODUCTION IN INDIA WITH ARIMA MODEL

Time Series Forecasting: A Tool for Out - Sample Model Selection and Evaluation

INDIAN INSTITUTE OF SCIENCE STOCHASTIC HYDROLOGY. Lecture -18 Course Instructor : Prof. P. P. MUJUMDAR Department of Civil Engg., IISc.

Transcription:

ECON/FIN 250: Forecasting in Finance and Economics: Section 8: Forecast Examples: Part 1 Patrick Herb Brandeis University Spring 2016 Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 1 / 40

Course Overview 1 Key Objectives 2 The Forecast Process 3 US GDP: Unit Root 4 Multi-Period Forecasts Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 2 / 40

Key Objectives 1 Key Objectives 2 The Forecast Process 3 US GDP: Unit Root 4 Multi-Period Forecasts Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 3 / 40

Key Objectives The Forecast Process US GDP: Unit Root Multi-Step Forecasts US GDP: Time Trend US Unemployment Gasoline Supply ARMAX Rolling & Recursive Forecasts Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 4 / 40

The Forecast Process 1 Key Objectives 2 The Forecast Process 3 US GDP: Unit Root 4 Multi-Period Forecasts Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 5 / 40

The Forecast Process Model Identification Residual Diagnostics Single & Multi-Step Forecasts Forecast Confidence Intervals Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 6 / 40

Examples US GDP US Unemployment US Gasoline Supply Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 7 / 40

US GDP: Unit Root 1 Key Objectives 2 The Forecast Process 3 US GDP: Unit Root 4 Multi-Period Forecasts Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 8 / 40

What Have We Done So Far? Looked at GDP visually with tsline; Log-linear Looked at ACF and PACF of lgdp Estimated AR(1) and AR(1/2); roots looked unstable Unit Root Test: Dickey Fuller (which flavor?); Concluded lgdp has unit root Now what? Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 9 / 40

Integrating Log Real GDP To integrate log real GDP, take the first difference y t = log(gdp t ) log(gdp t 1 ) (1) Model y t as an ARMA(p,q) or ARIMA(p,1,q) In words: US GDP growth rates follow ARMA We will still check time trend models too Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 10 / 40

Identifying the Process for Log Real GDP (y t ) In Stata: gen dgdp=d.lgdp and plot Check ACF and PACF; Some Correlation Model as AR(1), AR(2), MA(1), MA(2), ARMA(1,1); check roots Slight preference to AR models; simpler to estimate We will formalize some model selection criterion Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 11 / 40

Fitting AR Models AR models are easy to estimate Can use OLS In Stata use Lag operator This brings up a few theoretical issues Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 12 / 40

In Stata * estimate AR (2) with OLS reg dgdp L. dgdp L2. dgdp * now with arima command arima dgdp, ar (1/2) * MA (2) with arima arima dgdp, ma (2) * can also estimate fancy pattern arima dgdp, ar (1 3 5) * can estimate the full model from lgdp arima lgdp, arima (p,1,q) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 13 / 40

OLS & Lagged Dependent Variables Lagged dependent variables: y t = β 0 + αy t 1 + β 1 x t + η t η t is iid (independently and identically distributed) η t is weakly exogenous, E[η s x t, y t 1 ] = 0, s t OLS Properties Parameter estimates biased, consistent Asymptotic distributions and standard errors/tests correct Many time series models will be like this Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 14 / 40

Fitting ARMA Models These use numerical optimization procedures Computer searches for BEST parameters Maximum Likelihood Estimation (MLE) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 15 / 40

What are Likelihood Functions? Estimate the probability of data, given parameters Maximize Prob(Data Parameters) Computer over parameters and finds most likely choice Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 16 / 40

Estimating the Likelihood Estimated disturbances (ARMA(1,1)): ê t = y t φy t 1 θê t 1, σ 2 = Var[ê t ] (2) T T T 1 f t = f (ê t φ, θ, σ) = t=1 t=1 t=1 2πσ 2 exp[ ê2 t 2σ ] (3) 2 L = log( f t ) = 1 T T log(2πσ 2 êt 2 ) (4) 2 t=1 t=1 2σ 2 L = T 2 log(2πσ2 ) L = T 2 log(2πσ2 ) T t=1 ê 2 t 2σ 2 (5) Tt=1 ê 2 t 2σ 2 (6) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 17 / 40

Identification Methods Try Different Models Look at Parameter t-statistics (Standard Errors) Look at Residuals (Correlations and Q-Test) Look at Information Criterion Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 18 / 40

Portmanteau Q Test Model Residuals (where x t is vector of ARMA terms) ɛ t = y t x t β (7) Estimate autocorrelations, ˆρ j for L lags, for data with sample size T. (Note, these are NOT partial autocorrelations) Estimate the sum of the squared autocorrelations with fancy weights Q = T (T 2) 1 L 1 L T i ˆρ2 i (8) For white noise: Q χ 2 L Reject white noise (in favor of serial correlation) if Q > χ 2 L i=1 Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 19 / 40

Portmanteau Q Test * estimate arima (2,1,0) for log gdp arima lgdp, arima (2,1,0) * create residuals predict resid, res * test for white noise at 20 lags wntestq resid, lags ( 20) * test for white noise at ( this case ) 40 lags wntestq resid Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 20 / 40

Information Criterion Akaike Information Criterion (AIC) AIC = 2L + 2k (9) Bayesian Information Criterion (BIC) BIC = 2L + k log(t ) (10) Choose model with smallest AIC or BIC Computer will attempt to make L big The number of parameters, k, is a penalty More parameters result in larger AIC & BIC Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 21 / 40

Stata Diagnostics Compare 2 models * model 1 arima lgdp, arima (1,1,0) predict res 1, res estat aroots wntestq res 1, lags (10) estat ic * model 2 arima lgdp, arima (2,1,0) predict res 2, res estat aroots wntestq res 2, lags (10) estat ic Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 22 / 40

One-Step Ahead Forecasts * one - step ahead fcast for gdp growth rate arima dgdp, ar (1) predict yhat * compare growth rate to fcast scatter dgdp yhat tsline dgdp yhat * one - ste ahead fcast for GDP level arima lgdp, arima (1,1,0) predict fcast, y * compare to naive forecast gen naive = lgdp [_ n -1] tsline lgdp fcast naive if dateq > tq ( 2003 q 4) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 23 / 40

One-Step Ahead Forecast Comparison 9.5 9.55 9.6 9.65 9.7 2004q1 2007q1 2010q1 2013q1 2016q1 dateq lgdp naive y prediction, one step Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 24 / 40

95% Confidence Bands: Example AR(1) E[(y t+1 ŷ t+1 ) 2 ], [ŷ t+1 1.96ˆσ ɛ, ŷ t+1 + 1.96ˆσ ɛ ] (11) y t+1 = ρy t + ɛ t (12) ŷ t+1 = ˆρy t (13) y t+1 = ˆρy t + ˆɛ t+1 (14) E[(y t+1 ŷ t+1 ) 2 ] = E[(y t+1 ˆρy t ) 2 ] (15) = E[ɛ 2 t+1] (16) = σ ɛ (17) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 25 / 40

95% Confidence Bands: Example AR(1) Two Parts Don t know ɛ t+1 or σ ɛ Don t know true ρ Forecast uncertainty σŷ We will often ignore forecast uncertainty (smaller, more difficult) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 26 / 40

Confidence Bands: log(gdp) ARIMA(1,1,0) y t = log(gdp t ) (18) y t+1 = y t + x t+1 (19) x t+1 = a + ρx t + ɛ t+1 (20) E[(x t+1 E[x t+1 Ω t ]) 2 ] = E[(x t+1 (a + ρx t )) 2 ] (21) = E[ɛ 2 t ] (22) = σ 2 ɛ (23) [ŷ t+1 1.96ˆσ ɛ, ŷ t+1 + 1.96ˆσ ɛ ] (24) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 27 / 40

Confidence Bands: log(gdp) arima lgdp, arima (1,1,0) predict yhat, y predict sigma 2, mse gen sigma = sqrt ( sigma 2) gen yl = yhat - 1. 96* sigma gen yh = yhat + 1. 96* sigma tsline lgdp yhat yl yh if dateq > tq ( 2003 q 4) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 28 / 40

Confidence Bands: log(gdp) 9.5 9.55 9.6 9.65 9.7 9.75 2004q1 2007q1 2010q1 2013q1 2016q1 dateq lgdp yl y prediction, one step yh Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 29 / 40

In/Out of Sample Forecasts Recall the first days of our class? In sample forecasts can look too good Need to check out of sample Let s try this with GDP Easy to do with Stata Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 30 / 40

In/Out of Sample Forecast Comparison * we want to compare mse of in/ out sample use gdp * model 1: in sample arima lgdp, arima (1,1,0) predict fcast 1, y gen in_e2 = (lgdp - fcast 1)ˆ2 if dateq >= tq (2000 q1) * model 2: out of sample arima lgdp if dateq <tq (2000 q1), arima (1,1,0) predict fcast 2, y gen out _e2 = (lgdp - fcast 2)ˆ2 if dateq >= tq (2000 q1) * compare mse sum in_e2 out _e2 Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 31 / 40

Out of Sample Tests Need to be able to compare out of sample forecasting performance Choosing in and out of sample periods is difficult Large in sample estimation Good parameter estimates (in sample) Noisy MSE estimate (out of sample) Small in sample estimation Noisy parameter estimates (in sample) Good MSE estimate (out of sample) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 32 / 40

Multi-Period Forecasts 1 Key Objectives 2 The Forecast Process 3 US GDP: Unit Root 4 Multi-Period Forecasts Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 33 / 40

Two Flavors of Multi-Period Forecasts Direct: Build forecast for y t+h from t Recursive: Keep substituting one-step ahead forecasts into your equations Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 34 / 40

Recursive Multi-Period Forecasts Go more than one period into the future Replace endogenous variables with forecasts Example: AR(1) Remember all of our expected value theory from the last few classes? y t+1 = ρy t + ɛ t (25) ŷ t+1 = ˆρy t (26) ŷ t+2 = ˆρŷ t+1 = ˆρ 2 y t (27) ŷ t+3 = ˆρŷ t+2 = ˆρ 3 y t (28) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 35 / 40

Stata for Multi-Period Forecasts Dynamic option only works after an appropriate arima estimation dynamic(tq(2010q1)) starts the true forecast q1 2010 Questions? type help arima postestimation use gdp arima lgdp if dateq <= tq (2009 q4), arima (1,1,0) predict yhat, y dynamic (tq (2010 q 1)) tsline lgdp yhat if dateq > tq ( 2000 q 4) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 36 / 40

Multi-Period Forecast 9.4 9.5 9.6 9.7 9.8 2000q1 2005q1 2010q1 2015q1 dateq lgdp y prediction, dyn(tq(2009q4)) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 37 / 40

Multi-Step Confidence Bands y t+1 = ρy t + ɛ t+1 y t+2 = ρy t+1 + ɛ t+2 = ρ 2 y t + ρɛ t+1 + ɛ t+2 E(y t+2 ŷ t+2 ) 2 = ρ 2 σ 2 ɛ + σ 2 ɛ For big h, E(y t+h ŷ t+h ) 2 = σ 2 ɛ h 1 i=0 (ρ 2 ) i E(y t+h ŷ t+h ) 2 = σ 2 ɛ (ρ 2 ) i = 1 i=0 1 ρ 2 σ2 ɛ = Var[y t ] Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 38 / 40

Finally: A Real Forecast What does our model say about future GDP? How would you produce actual forecasts? Need tsappend use gdp * use full sample arima lgdp, arima (1,1,0) * add 8 quarters to the data set tsappend, add (8) * try without dynamic predict yhat 1, y * now try dynamic with date predict yhat, y dynamic (tq (2016 q 1)) tsline lgdp yhat if dateq > tq ( 2001 q 4) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 39 / 40

Real Forecast of log(gdp) 9.4 9.5 9.6 9.7 9.8 2002q1 2006q1 2010q1 2014q1 2018q1 dateq lgdp y prediction, dyn(tq(2016q1)) Patrick Herb (Brandeis University) Forecast Examples: Part 1 ECON/FIN 250: Spring 2016 40 / 40