VAR Forecast with Exogenous Variable

Questions and discussions on Vector Autoregressions
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

VAR Forecast with Exogenous Variable

Unread post by Jules89 »

Dear Tom,

I have estimated a VAR with an exogenous variable. For example with the haversample data:

Code: Select all


open data haversample.rat
cal(q) 1959
data(format=rats) 1959:1 2006:4 ftb3 gdph ih cbhm

set loggdp = log(gdph)
set loginv = log(ih)
set logc   = log(cbhm)

compute lags=4                                
system(model=var)
   variables loggdp loginv logc
   lags 1 to lags
   det constant ftb3{1 to lags}
end(system)

estimate(noprint,ols,sigma)                                      

Now I want to use the forecast instruction to do out of sample forecasts. In the instruction manual it is written:
"Exogenous variables require some care, as you need values for them throughout the forecast period. If a variable is not the dependent variable of one of the equations, FORECAST takes its values over the forecast horizon from its data series. If you are forecasting out-of-sample, you have two basic ways to handle exogenous variables:

Close the model by adding to it equations or formulas, such as univariate autoregressions, that forecast the exogenous variables.
Set up time paths for the variables (prior to forecasting) with SET or DATA or some other instruction that will directly provide the values.
"
I don't understand what is meant by "Close the model by adding to it equations or formulas, such as univariate autoregressions, that forecast the exogenous variables."
How would I use the instruction to do the forecasts? Is there anything special to it or is it just:

Code: Select all

forecast(model=var, start=%regend(), steps=10, results=forecasts)
Thank you

Best Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VAR Forecast with Exogenous Variable

Unread post by TomDoan »

That would work if you want to forecast based upon observed values for the exogenous variable. If you don't have those over the forecast period, then you have to forecast them somehow. Closing the model means exactly that---you have four variables, you need four equations, one of which does ftb3 depending just upon its own lags.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: VAR Forecast with Exogenous Variable

Unread post by Jules89 »

Thanks for your reply,

does that mean I have to estimate something like

Code: Select all


set loggdp = log(gdph)
set loginv = log(ih)
set logc   = log(cbhm)

compute lags=4                               
system(model=var)
   variables loggdp loginv logc
   lags 1 to lags
   det constant ftb3{1 to lags}
end(system)

estimate(noprint,ols,sigma)           

linreg(define=ftbeq) ftb3
# ftb3{1 to lags}

group varmodel  var ftbeq

forecast(model=var, start=%regend(), steps=10, results=forecasts)

How would I implemt that if I don't want to estimate a full system like:

Code: Select all


compute lags=4                               
system(model=var)
   variables loggdp loginv logc ftb
   lags 1 to lags
   det constant
end(system)


Thank you in advance

Jules
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VAR Forecast with Exogenous Variable

Unread post by TomDoan »

In your first, do

forecast(model=var+ftbeq, start=%regend(), steps=10, results=forecasts)
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: VAR Forecast with Exogenous Variable

Unread post by Jules89 »

Sorry the group instruction was wrong. Here it is

Code: Select all


open data haversample.rat
cal(q) 1959
data(format=rats) 1959:1 2006:4 ftb3 gdph ih cbhm

set loggdp = log(gdph)
set loginv = log(ih)
set logc   = log(cbhm)

compute lags=4                               
system(model=var)
   variables loggdp loginv logc
   lags 1 to lags
   det constant ftb3{1 to lags}
end(system)

estimate(noprint,ols,sigma)                 


linreg(define=ftbeq) ftb3
# ftb3{1 to lags}

forecast(model=var+ftbeq, from=%regend(), steps=10, results=forecasts)
Post Reply