Economics 430
Lecture 8
Forecasting with Regression Models
1
Today’s Class 1 of 2
• ConditionalForecastingModelsandScenario Analysis
• UncertaintiesinConfidenceIntervalsfor Conditional Forecasts
• UnconditionalForecastingModels
• Lags
– Distributed
– Polynomial Distributed – Rational Distributed
• Regressions with
– Lagged Dependent Variables – ARMA Disturbances
– Transfer Function Models
2
Today’s Class 2 of 2
• Vector Autoregressions (VAR)
• Predicative Causality
• Impulse-Response Functions and Variance Decomposition
• R Example
• Two Examples of
– Vector Autoregressions (VAR)
– Predicative Causality (Granger-Causality) – Impulse-Response Functions (IRF)
3
Regression Model
• Regression Models (a.k.a. Causal or Explanatory Models): Example, consider a linear model
and
Endogenous Variable
• Conditional Forecasting Model: Model used for forecasting e.g., y conditioned on other variables.
• Scenario Analysis (or Contingency Analysis): Forecast y conditional on an assumed future value of x. Let x* = h-step- ahead value of x
Exogenous or Explanatory Variables
(h-step-ahead conditional forecast for y) (conditional density forecast)4
Uncertainties in Confidence Intervals
for Conditional Forecasts
• Forecastsaresubjecttoerror.Inthecaseof scenario forecasts, we can identify at least 3:
– Specification Uncertainty: Due to model simplifications.
– Innovation Uncertainty: Due to unknown future innovations when the forecast is made.
– Parameter Uncertainty: Due to estimation of the model coefficients.
• Inthecaseoftheconditionalforecastingmodel, we can quantify the innovation and parameter uncertainties.
1 of 2
5
•
Consider the Linear model: where x has zero mean. Want to predict at
and
Uncertainties in Confidence Intervals
for Conditional Forecasts
2 of 2
Density Forecast
6
Unconditional Forecasting Models
• Forecasting the right-hand-side Variables Problem: To get an optimal unconditional point forecast for y, we need to insert the optimal point forecast, xT+h, T .
• Unconditional Forecast:
Model for y not for x.
• A Solution: Fit an autoregressive model to x, forecast x (i.e.,
), and then use the forecast of x to forecast y.
• Better Solution: Estimate all the parameters simultaneously
by regressing y on xt-h, xt-h-1, …
We can forecast e.g., 1-step-ahead using the model:
7
Distributed Lags 1 of 2
• We can generalize the forecasting model to the Distributed Lag Model:
• In this model, y depends on a distributed lag of past x’s.
δi = lag weights, and their pattern is the lagged distribution. Nx = number of lags of x.
• Polynomial Distributed Lags: If Nx is too large, we can instead use a low order polynomial lag distribution. The benefits are that you can improve your forecasting performance with a sophistically simple model (considerably fewer parameters than Nx+1).
8
Distributed Lags 2 of 2
• Rational Distributed Lags: Promote smoothness in the lag distribution but are less restrictive than the low-order-polynomial. For example, if A(L) an B(L) are low-order polynomials in the lag operator, then
• Therefore,
Both, lags of x and y are now present
9
Regressions with Lagged Dependent Variables Regressions with ARMA Disturbances
• Given y.
• Abettermodel:
• Alternativemodel:
, we left out the past of
Distributed Lag Regression model with Lagged dependent variables.
Distributed Lag Regression model
with ARMA disturbances. 10
Regressions with Lagged Dependent Variables Regressions with ARMA Disturbances
• Ingeneral,distributedlaggedregressionswithlagged dependent variables or ARMA Disturbances, are both special cases of Transfer Function Models.
• TransferFunction:
• NoticethatARMAmodelsareaspecialcase,A(L)=0. 11
Transfer Function Models
12
Vector Autoregressions (VAR)
• VAR(p): An N-variable vector autoregression of order p. We estimate N different equations. In each equation, we regress the relevant l.h.s variable on p lags of itself, and p lags of every other variable.
• Vectorautoregressionsallowforcross-variable dynamics.
• Example:Twovariables(y1andy2)VAR(1).
and
13
Impulse-Response Functions (VMA)
and Variance Decompositions
• Impulse-ResponseFunctions(IRFs):Describehowthe economy reacts over time to exogenous impulses, which economists usually call ‘shocks’, and are often modeled in the context of a vector autoregression.
• Strategy:IntheMArepresentation,wecannormalize the coefficients of εt to values different from unity.
• Letbi’=bimandεt=εt/m.Ifm=1MA,however,we can try m = σ instead.
1 of 3
14
Impulse-Response Functions (VMA)
and Variance Decompositions
• For the multivariate case: How does a unit shock to εi affect yj, now and in the future, for all combinations of i and j ?
• FortheVAR(1)bivariatecase,assumingy1isordered first.
2 of 3
15
Impulse-Response Functions and
Variance Decompositions
• Algorithm(forthebivariatecase):
• Normalize the system for e.g., y1.
• Compute the response of y1 to a unit normalized innovation to y1, { }.
• Compute the response of y1 to a unit normalized innovation to y2, { }.
• Compute the response of y2 to a unit normalized innovation to y2, { }.
• Compute the response of y2 to a unit normalized innovation to y1, { }.
Note: { } = Impulse Response Functions
3 of 3
16
IRF: Response to a positive spending shock
(article link)
The government spending shock is highly persistent and turns insignificant after 2.5 years.
1 of 3
17
IRF: Response to a positive spending shock
(article link)
The GDP response turns slightly negative after 2 years possibly due to the persistently higher level of real interest rates.
18
2 of 3
IRF: Response to a positive spending shock
(article link)
Net taxes respond positively to the spending increase with the response peaking in the second quarter.
3 of 3
19
VAR(p) Algorithm
• Q: How to determine the order p of the VAR model?
• Solution:
– Start with p=1, compute VAR(1)
– Continue with p=2, and keep the one with lowest AIC and BIC
– Continue with p= 3, 4, …
– After a certain value of p, AIC & BIC will worsen, therefore, decide on the model with lowest overall AIC and BIC.
20
VAR Example 1 Housing Starts and Completions
Business Cycles
21
VAR Example 1 Housing Starts and Completions
ACF0 (slowly)
PACF has a Sharp cut off
at lag =2.
22
VAR Example 1 Housing Starts and Completions
ACF0 (slowly)
PACF has a Sharp cut off
at lag =2.
23
VAR Example 1 Housing Starts and Completions
Completions are maximally correlated with starts lagged by 6-12 months.
Q: Do comps depend of starts, or do starts depend on comps?
ρCC ≈ 0.90
Def: Cross-Correlation = ACF for the multivariate case
24
Regression Results VAR(4) Model Equation 1:
starts = c + startst-k + compst-k
25
Regression Results VAR(4) Model Equation 2:
A: It appears that comps depend on starts
Ask R which one is it?
26
comps = c + startst-k + compst-k
VAR Example 1 Housing Starts and Completions
Predicative Causality (Granger-Causality)
• Q: Do comps ‘Granger-cause’ starts? library(lmtest)
Grangertest(starts~comps,order=4)
R commands
Granger causality test
H0: comps do not cause starts
Model 1: starts ~ Lags(starts, 1:4) + Lags(comps, 1:4) Model 2: starts ~ Lags(starts, 1:4)
Res.Df Df F Pr(>F)
1 329
2 333 -4 2.3066 0.05801 .
—
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
A:Fail to reject H0 No!
27
VAR Example 1 Housing Starts and Completions
Predicative Causality (Granger-Causality)
• Q: Do starts ‘Granger-cause’ completions?
library(lmtest) grangertest(comps~starts,order=4)
R commands
Granger causality test
H0: starts do not cause comps
Model 1: comps ~ Lags(comps, 1:4) + Lags(starts, 1:4) Model 2: comps ~ Lags(comps, 1:4)
Res.Df Df F Pr(>F)
1 329
2 333 -4 32.125 < 2.2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
A: Reject H0Yes!
28
VAR Example 1 Housing Starts and Completions
Residuals
Residuals ACF
Residuals PACF
29
VAR Example 1 Housing Starts and Completions
-Completions
-Fit
30
VAR Example 1 Housing Starts and Completions
31
VAR Example 1 (IRF) Housing Starts and Completions
Effect of starts on starts
Own-Variable Impulse Response
Effect of starts’ shock on subsequent starts: Initially a large effect but then decays slowly.
Cross-Variable Impulse Response
Effect of starts’ shock on subsequent comps: Initially produces no movement, then
builds up, peaking around 14 months.
Effect of starts on comps
32
VAR Example 1 (IRF) Housing Starts and Completions
Effect of comps on starts
Cross-Variable Impulse Response
Effect of comps’ shock on subsequent starts: Initially produces little movement in starts at all times.
Own-Variable Impulse Response
Effect of comps’ shock on subsequent comps: Initially a large effect but then decays slowly.
Effect of comps on comps
33
VAR Example 2
House Price Growth in LA & Riverside
16 12 8 4 0 -4 -8 -12
-16
1975 1980 1985 1990 1995 2000 2005 2010
They move together
Does Riverside depend on LA or does LA depend on Riverside?
Growth rate in Riverside Growth rate in Los Angeles
34
VAR Example 2
House Price Growth in LA & Riverside
• The two economies are linked via commuters Increase in economic activity in LA
Increase in demand for housing in LA
LA housing prices go up
Demand for houses in Riverside go up
LA Economic ActivityRiverside Economic Activity Riverside Economic ActivityLA Economic Activity ?
35
VAR Example 2
House Price Growth in LA & Riverside
• LetY=LosAngelesandX=Riverside • TryVAR(1)Model
Yt = c1+ α11Yt-1+β11Xt-1+ε1t = 0.25+0.79Yt-1+0.04Xt-1
Xt = c2+ α21Yt-1+β21Xt-1+ε2t = -0.36+0.89Yt-1+0.05Xt-1
1% growth in LA0.9% growth in Riverside
36
VAR Example 2
House Price Growth in LA & Riverside
Preferred Model = VAR(1)
37
VAR Example 2
House Price Growth in LA & Riverside
Granger Causality Test
LA does Granger-Cause Riverside
H0: Riverside has no effect on LA (β11=0) Fail to reject H0
H0: LA has no effect on Riverside (α21=0) Reject H0
LA Market is useful in predicting the Riverside Market
38
Impulse-Response Functions
Riverside market effect from a shock in the LA market
Large
LA market effect from a shock in the Riverside market
Small
39
40
15 10 5
VAR Example 2
House Price Growth in LA & Riverside
15 10 5
Estimation sample
Prediction sample
Estimation sample
Prediction sample
00 -5 -5 -10 -10
-15 -15 86 88 90 92 94 96 98 00 02 04 06 08 10
86 88 90 92 94 96 98 00 02 04 06 08 10
LA House Price Growth
Upper bound (95% confidence interval) Lower bound (95% confidence interval)
Riverside House Price Growth
Upper bound (95% confidence interval) Lower bound (95% confidence interval)
41