Balke(2000) Threshold VAR

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

No. The evidence in favor of a threshold isn't very strong given the number of additional parameters required in the non-linear model.
Bach
Posts: 9
Joined: Tue Oct 25, 2016 3:29 pm

Re: Balke(2000) Threshold VAR

Unread post by Bach »

Thanks Tom, appreciate the quick turnaround. It is clear.

Another question if I may. I am trying to create the IRF for my 3 variable VAR ( GDP, Spending and Tax) using as a threshold an external variable ( output gap).

For some reasons, when I run the program I get this error message " ## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 316, Line 9 of loop/block "


Do you see any issue there ( I haven't changed the code much) and I am using 1st difference for all variables for my 3-variable-VAR to achieve stationarity.
Appreciate your help ( IRF program and Excel are attached)
Best
Attachments
Bach_TVAR_IRF.RPF
(9.15 KiB) Downloaded 1112 times
FISCAL_3var_Final.xls
(32 KiB) Downloaded 790 times
Last edited by Bach on Mon Oct 31, 2016 4:08 pm, edited 1 time in total.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

Bach wrote:Thanks Tom, appreciate the quick turnaround. It is clear.

Another question if I may. I am trying to create the IRF for my 3 variable VAR ( GDP, Spending and Tax) using as a threshold an external variable ( output gap).

For some reasons, when I run the program I get this error message " ## SR10. Missing Values And/Or SMPL Options Leave No Usable Data Points
The Error Occurred At Location 316, Line 9 of loop/block "


Do you see any issue there ( I haven't changed the code much) and I am using 1st difference for all variables for my 3-variable-VAR to achieve stationarity.
Appreciate your help ( IRF program and Excel are attached)
Best
This is using the old threshold variable on the second line

equation(identity,coeffs=macoeffs) threqn GAPthr
# gdp{0 to malength-1}
Bach
Posts: 9
Joined: Tue Oct 25, 2016 3:29 pm

Re: Balke(2000) Threshold VAR

Unread post by Bach »

HI Tom ,
Thanks again for your response.
I have couple of quick questions , if I may.

(a) I am looking at Balke's paper and see that graphs of the tight regime are generated using the command upper =1. I am not clear about the reason since my understanding is that under the tight regime, the credit ( threshold variable) is expected to be below the threshold and thus the lower regime should be the one selected (i.e. upper =0), Am I missing something in my reasoning ?

(b) I am assuming that IRF program uses a recursive SVAR model ( in the ordering of the variables below), rather than a standard VAR correct ?

Code: Select all

compute depvars    =||d1y,d1p,money,credit||
Thanks in advance
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

Bach wrote:HI Tom ,
Thanks again for your response.
I have couple of quick questions , if I may.

(a) I am looking at Balke's paper and see that graphs of the tight regime are generated using the command upper =1. I am not clear about the reason since my understanding is that under the tight regime, the credit ( threshold variable) is expected to be below the threshold and thus the lower regime should be the one selected (i.e. upper =0), Am I missing something in my reasoning ?
That depends upon what the credit measure is. In the example, it's the spread between commercial paper and the t-bill rate, where tight would mean higher values.
Bach wrote: (b) I am assuming that IRF program uses a recursive SVAR model ( in the ordering of the variables below), rather than a standard VAR correct ?

Code: Select all

compute depvars    =||d1y,d1p,money,credit||
Correct.
Bach
Posts: 9
Joined: Tue Oct 25, 2016 3:29 pm

Re: Balke(2000) Threshold VAR

Unread post by Bach »

Thanks Tom for the quick response.
I have a follow up question .Is it normal to have Balke and Tsay approaches producing two different threshold results?
And, is there a way to replicate the result of the Balke threshold value using the TSay approach ?
Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

It depends. The Tsay usrates example uses var=homogeneous, and Balke uses var=heterogeneous. That will give you different results. Tsay uses an equally spaced grid search, Balke uses the empirical values of the threshold series. That will give you different results. The use of the grid makes more sense in the Tsay example where he has over 400 entries and is looking for double breaks, while Balke has about 140 and is looking for a single break (though both of these were done 20 or so years ago, so what might have seemed infeasible then wouldn't be now). Both are picking the likelihood maximizing break value so if you use the same likelihood (variance option on the SWEEP) and test for the same possible break points, you'll get the same results.
kinogutschein
Posts: 2
Joined: Tue Mar 14, 2017 4:46 am

Re: Balke(2000) Threshold VAR

Unread post by kinogutschein »

Dear Mr. Doan,

I am working on a TVAR with 2 regimes and 4 variables: GDP, Consumer Prices, interest rates and uncertainty.

I didnt change the code much. For the lower regime (upper=0) I receive reasonable results. However, once I switch to the upper regime (upper=1), I receive the following error message:
## FO19. Forecast for LGER_GDP solves to NA at 1997:06, on iteration 1.

The Error Occurred At Location 784, Line 40 of loop/block
I get this message for every variable in my TVAR. I am not sure what causes this error. I have added both code and data to this post.

Thank you for your concern.
Attachments
Daten.xlsx
Data
(106.81 KiB) Downloaded 756 times
TVAR.RPF
(12.12 KiB) Downloaded 1146 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

I get a problem right away with this when you do the diagnostics:

dofor i = 1 2 3 4 5
dofor lag = 1 2 3 4 5 6
@regcorrs(noprint,dfc=%narma,number=lag,qstats,nograph, method=burg,title="AR(4) model diagnostics;RGDP") resids(i)
disp "Gleichung" i "Lag" lag #.### %Qsignif
end dofor
end dofor

since you have only 4 series. You might want to pull the definition of NVAR up higher (right after the ESTIMATE) and run those dofor i's over 1 to NVAR so it will adapt to the number of series in the model.

You also have a problem here, where you didn't adapt to the 4 variable system:

*
* This is application specific. A different number of variables requires
* a different list of the tvarf's.
*
group tvar tvarf(1) tvarf(2) tvarf(3) tvarf(4) tvar(5) thrfrml

I suspect that you sent me something other than the one that's giving you the posted difficulty since what you sent doesn't run at all.
kinogutschein
Posts: 2
Joined: Tue Mar 14, 2017 4:46 am

Re: Balke(2000) Threshold VAR

Unread post by kinogutschein »

Thank you for your advice. This was actually the Code that I intended to send. I wasn't aware of the first issue you mentioned. Regarding the second issue I thought I corrected it already, thank you. I reviewed the Code that I attached to this post and now it should be correct. As I mentioned before, for upper=0 it gives reasonable results. If changed to upper=1, the beforementioned Errors happen. Am I missing something? Thanks for your concern.
Attachments
Daten.xlsx
(106.81 KiB) Downloaded 777 times
TVAR.RPF
(12.06 KiB) Downloaded 1133 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

Your GER_GDP data ends before the end of your intended sample. When you bootstrap, that can pull the NA's into the initial range---it probably only affects the upper branch because those are *in* only the upper branch.
stan076
Posts: 9
Joined: Mon Mar 27, 2017 10:37 pm

Re: Balke(2000) Threshold VAR

Unread post by stan076 »

Is that possible to estimate a VAR with inclusion of exogenous variable and let this variable be the threshold indicator?

e.g.

Code: Select all

system(model=varmodel)
variables d1y d1p money 
lags 1 to maxlag
det constant credit
end(system)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

Partially yes. The estimation would be effectively the same. However, the IRF's are completely different because with an exogenous variable governing the switch, you can compute only the regime-specific IRF's (which is a simpler calculation).
stan076
Posts: 9
Joined: Mon Mar 27, 2017 10:37 pm

Re: Balke(2000) Threshold VAR

Unread post by stan076 »

Hi
Is there any reference on how to generate regime-specific IRF with RATS?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Balke(2000) Threshold VAR

Unread post by TomDoan »

There's nothing special about it. It's just a standard IRF (done with IMPULSE). With an exogenous threshold variable, you get two separate linear models rather than one non-linear one.
Post Reply