Error Bands on IRFs in TVAR

Discussion of models with structural breaks or endogenous switching.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Error Bands on IRFs in TVAR

Unread post by Jules89 »

Dear Tom,

I have got another question regarding the residual based bootstrap for the confidence bands. Assume that I have a VAR-X model of the form y(t)=a+B(L)y(t)+C(L)x(t)+e(t). The vector of exogenous regressors x(t) has no own equation in the VAR. Assuming now a threshold VAR-X, I need to define additional equations for the x(t) vector to do the out-of-sample forecasting for the GIRFs. Lets say I define another VAR for the x variables: x(t)=b+D(L)x(t-1)+c(t). As the x(t) variables are exogenous (and I am not interest in shocks of those) they are not affected by the switching, therefore the "exogenous" VAR is a simple linear one. I would add the equations of the "exogenous" VAR to the threshold VAR equations to get the full model:

group tvar tvarf(1) ... tvarf(n) exo(1) ... exof(m) thrfrml

My question regarding the residual based bootstrap for confidence bands is the following one: When I am simulating data for reestmation, should I also resample the data for the exogenous variables, or should I use the original data? The model I have in mind would be a local economy, which has no impact on the outside would, but for which the outside world would have an impact on the local economy.

Thank you in advance

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

Re: Error Bands on IRFs in TVAR

Unread post by TomDoan »

If it's actually exogenous, why don't you just take it as known and condition the bootstrap on it?
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Error Bands on IRFs in TVAR

Unread post by Jules89 »

Thanks Tom,

I assume that your answer is about the residual based bootstrap for the confidence bands.
Regarding the GIRF bootstrap for the T-VARX model I have got another question.Since the exogenous variables do not have own equations, I have to add equations to the model to do the out of sample forecasting for the GIRFs, correct?
Do I have to load those forecasts also with residuals?

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

Re: Error Bands on IRFs in TVAR

Unread post by TomDoan »

You can restrict your attention to the initial conditions which allow enough entries in-sample for the X's out to the IRF horizon. Yes, if you want to do true out-of-sample forecasting, you need to have some source for the X's.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: Error Bands on IRFs in TVAR

Unread post by Jules89 »

Dear Tom,

I have a dataset for which I want to estimate the threshold within a threshold VAR-X. The threshold function is one of the variables of the TVAR-X.
The data are applied and the code is given by

Code: Select all


*********************
**** Read in Data ***
*********************

OPEN DATA "...\test sweep.XLSX"
CALENDAR(M) 2004:1
DATA(FORMAT=XLSX,ORG=COLUMNS) 2004:01 2017:12 XRSMPL1 XRSMPL2 XRSMPL3 RSMPL1 RSMPL2 RSMPL3 RSMPL4 RSMPL5 $
 RSMPL6

compute maxlag=2

compute rstart = 2004:1                                      
compute rend = 2017:12
compute pi= 0.1


system(model=varxb)
   variables rsmpl1 rsmpl2 rsmpl3 rsmpl4 rsmpl5 rsmpl6
   lags 1 to maxlag
   det xrsmpl1{1 to maxlag} xrsmpl2{1 to maxlag} xrsmpl3{1 to maxlag} constant
end(system)

estimate(print,model=varxb) rstart rend
compute loglr = %logl
compute bestlogl=%logl


compute piskip=fix(pi*%nobs)+%nreg                                            
compute pistart=rstart+piskip
compute piend=rend-piskip



set copy rstart rend = rsmpl6{1}                                                                                  
order copy rstart rend


do pientry=pistart,piend

   compute thr=copy(pientry)

   sweep(var=hetero,group=rsmpl6{1}<thr) rstart rend              
   # %modeldepvars(varxb)
   # %rlfromeqn(%modeleqn(varxb,1))

   display %logl loglr
   if %logl>bestlogl                                                     
       compute bestlogl=%logl,bestthresh=thr

end do pientry

As you can see, the sweep instruction generates the same likelihood for every iteration/group. Moreover the likelihood is the same as in the baseline, full sample, linear estimation. There must be something wrong, could you have a look at it?


Thank you in advance

Jules
Attachments
test sweep.XLSX
(24.67 KiB) Downloaded 935 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Error Bands on IRFs in TVAR

Unread post by TomDoan »

You're using a hard value for RSTART which doesn't allow for lags, which messes up the bookkeeping. If you want to use the full data range (which looks like it's the case), don't set RSTART and REND until after you've done the ESTIMATE instruction, after which you can make RSTART=%REGSTART() and REND=%REGEND().
Post Reply