Page 5 of 7

Re: Balke(2000) Threshold VAR

Posted: Sat May 06, 2017 11:11 pm
by applej
Hi, Tom,
I got the upper and lower regime covariance\correlation matrices. I want to put it in my paper to demonstrate regime difference. However, almost all covariance pair show zeors, which does not show regime-distinctive enough. Does that look acceptable? Or, how can I increase the decimals in the matrices ?
Thank you,
J

Re: Balke(2000) Threshold VAR

Posted: Sun May 07, 2017 9:48 am
by TomDoan
If you're using logged variables, the simplest solution is to switch to 100*log's which will shift the scale on the variances by 10^4. However, you can reformat the existing numbers by using Window-Report Windows to reload the report, and then View-Change Layout.

Re: Balke(2000) Threshold VAR

Posted: Sat May 27, 2017 10:01 am
by stan076
Dear TomDoan

I have a question. Let say I take V as my threshold variable, since its level has a unit root, I decide to take first difference of V, as denoted by DV. I then take the absolute value of DV and name it as AV.

In this case, the threshold variable is in fact AV, but the variable that should enter the VAR model is DV.

So I just replace the threshold variable 'credit' as 'AV' in your tvar_estimate.rpf and tvar_irf.rpf, but for the VAR system, I put DV as dependent variable.

Is that all I need to do? Will I run into any potential problem for doing so?

Thanks.

Re: Balke(2000) Threshold VAR

Posted: Sat May 27, 2017 10:10 am
by TomDoan
I'm a bit confused. The threshold variable should be whatever you think triggers the change in regime---if it has a unit root, it has a unit root. The estimation itself only requires that you are able to compute the threshold variable so in that sense it doesn't matter how it relates to the actual data. Where that matters is when try to do impulse responses since that has to include an identity for defining the threshold based upon the simulated data.

Re: Balke(2000) Threshold VAR

Posted: Sat May 27, 2017 1:58 pm
by applej
Hi, Tom,
I got another question about Covariance\Correlation Matrix. I'm not sure whether what I got looks right. I have five series in percent.
five_series.JPG
five_series.JPG (89.3 KiB) Viewed 22332 times
After estimation, their vcv in upper, lower and linear,regimes:
vcv
vcv
vcv.JPG (145.09 KiB) Viewed 22332 times

Does it seem right in terms of magnitudes?

Thank you,
J

Re: Balke(2000) Threshold VAR

Posted: Sat May 27, 2017 5:33 pm
by TomDoan
Obviously a .00004 correlation is really small, but if you look at all three correlations for that pair, they're effectively zero so it may be a bit of a fluke, but isn't unreasonable.

Re: Balke(2000) Threshold VAR

Posted: Sat May 27, 2017 8:37 pm
by applej
TomDoan wrote:Obviously a .00004 correlation is really small, but if you look at all three correlations for that pair, they're effectively zero so it may be a bit of a fluke, but isn't unreasonable.
Thank you. Is the "7014" co-variance/variance ok? :roll:

Re: Balke(2000) Threshold VAR

Posted: Sun May 28, 2017 12:43 pm
by TomDoan
Why wouldn't it be? This is your model and your data---it looks like a noisy series and the three values for that 1st variable variance are all relatively similar, so I'm not sure what you think is the problem.

Re: Balke(2000) Threshold VAR

Posted: Fri Jun 30, 2017 10:35 am
by applej
TomDoan wrote:Why wouldn't it be? This is your model and your data---it looks like a noisy series and the three values for that 1st variable variance are all relatively similar, so I'm not sure what you think is the problem.
Thanks. It's just too large. But I think the calculation is right.(It's real oil return. )

Re: Balke(2000) Threshold VAR

Posted: Mon Jul 31, 2017 4:57 am
by yizhuorui
Dear tom,
my modified nonlinear impulse response of Balke(2000) runs OK,but i find the IRFs lacks of confidence interval, so i wonder if there is a way to construct the confidence interval or regarding code?
Best Regards,
Zhuorui YI

Re: Balke(2000) Threshold VAR

Posted: Mon Jul 31, 2017 1:23 pm
by TomDoan
The IRF's themselves are generated as the mean of a double bootstrap. I haven't seen anyone describe how to do confidence bands on those.

Re: Balke(2000) Threshold VAR

Posted: Thu Aug 10, 2017 4:06 am
by yizhuorui
Dear tom,
i am confused about the following code:

set fiddlef = %ran(1.0)
do i=1,%nvar
set fiddled(i) = fiddlef*u(i)
end do i
why do you multiply fiddlef by u(i)?
thanks

Re: Balke(2000) Threshold VAR

Posted: Thu Aug 10, 2017 8:13 am
by TomDoan
That's part of the fixed regressor bootstrap. If you want to understand that better, you'll have to read Hansen's paper or get the 2nd edition of the Structural Breaks and Switching Models course, which covers that.

Re: Balke(2000) Threshold VAR

Posted: Mon Jan 08, 2018 7:18 am
by Jules89
Dear Tom,

I have two questions related to the Balke IRF code:

First:

what does the "&" infromt of the loop index ("i") within the following loop do?

do i=1,nvar
frml tvarf(i) depvars(i) = %if(thrfrml{d}>thresh,$
fitud(&i,1)+%dot(%xrow(sup,&i),bootres),$
fitud(&i,2)+%dot(%xrow(sdn,&i),bootres))
end do i


Second:

Within the bootstrap, when the residals are drawn from their empirical distribution (gset bootuv wstart wend = %if(%ranflip(.5),+1,-1)*stdu(rentries(t))), why do we need this factor %if(%ranflip(.5),+1,-1)? It draws from a binominal a 1 or a -1 both with probability 0.5. Why do we need this random sign flip of the residual draws?


Thanks

Best Jules

Re: Balke(2000) Threshold VAR

Posted: Mon Jan 08, 2018 10:11 am
by TomDoan
Jules89 wrote:Dear Tom,

I have two questions related to the Balke IRF code:

First:

what does the "&" infromt of the loop index ("i") within the following loop do?

do i=1,nvar
frml tvarf(i) depvars(i) = %if(thrfrml{d}>thresh,$
fitud(&i,1)+%dot(%xrow(sup,&i),bootres),$
fitud(&i,2)+%dot(%xrow(sdn,&i),bootres))
end do i
See Defining FRML's in a loop. It forces the I references to be resolved immediately, while the FRML's are being defined.
Jules89 wrote: Second:

Within the bootstrap, when the residals are drawn from their empirical distribution (gset bootuv wstart wend = %if(%ranflip(.5),+1,-1)*stdu(rentries(t))), why do we need this factor %if(%ranflip(.5),+1,-1)? It draws from a binominal a 1 or a -1 both with probability 0.5. Why do we need this random sign flip of the residual draws?
We don't need to do the random sign flip. That's a simple case of a wild bootstrap, which adjusts the raw residuals to produce a set which has particular properties---symmetry in this case.