Balke(2000) Threshold VAR
Re: Balke(2000) Threshold VAR
You can't have D=0---that makes a circular definition of the threshold.
The "location" doesn't really help much. You can do the "Edit-Show Last Error" to point to the loop that causes the problem, then find the line number within that.
The "location" doesn't really help much. You can do the "Edit-Show Last Error" to point to the loop that causes the problem, then find the line number within that.
Re: Balke(2000) Threshold VAR
Oh, it's good to know ! Thank you so much for examining the details. If lag=3 in VAR, does that mean threshold delay must >3, or just 1 or 2 would also workable? No problem, I am just thinking about that. I'll try this!TomDoan wrote:You can't have D=0---that makes a circular definition of the threshold.
The "location" doesn't really help much. You can do the "Edit-Show Last Error" to point to the loop that causes the problem, then find the line number within that.
Re: Balke(2000) Threshold VAR
It just has to be >0 (i.e. predetermined). d=0 means the threshold depends upon the current value and the current value depends upon the threshold. That's what creates the circularity so you can't solve the system.
Re: Balke(2000) Threshold VAR
Dear Tom,TomDoan wrote:It just has to be >0 (i.e. predetermined). d=0 means the threshold depends upon the current value and the current value depends upon the threshold. That's what creates the circularity so you can't solve the system.
Thank you so much for explaining it again. It works well now after I set d=1, though lags=3.
Yet, it seems I come to another question: How I can bookkeeping the ndraws of GIRF(1)(5,1) ? Here is my explanation:
-I suppose, in current program, for "GIRF(1)(5,1) " means for+1SD shock on var1, the responses of var5.
-I want to make confidence band for this simulated series.
-In order to do so, I suppose I would need something like :
Code: Select all
dec vect[seires] GIRFall(ndraws)
do time =istart, iend
ewise GIRFall(i) = GIRF(ndraws)(1)(5,1) (time+1-istart)
compute ff=%fractiles( GIRFall, || 0.16, 0.5, 0.84|| )
compute lower(t) = ff(1)
compute upper(t)= ff(3)
compute median(t) = ff(2)
end do time
Code: Select all
infobox(action=define,lower=1,upper=nrep,progress) "Bootstrapping Across Initial Values"
do jrep=1,nrep
infobox(current=jrep)
*
* Copy observed data into depvar slots
*
compute basedate=rdates(jrep)
do i=1,nvar
set depvars(i) wstart-maxlag wstart-1 = data(i)(t-wstart+basedate)
end do i
*
* Loop over bootstrap replications
*
do krep=1,nkrep
*
* Generate the bootstrap shuffle
*
boot rentries wstart wend rstart rend
*
* Generate the base set of shocks by premultiplying the
* bootstrapped standardized shocks by the factor of the overall
* covariance matrix.
*
gset bootuv wstart wend = %if(%ranflip(.5),+1,-1)*stdu(rentries(t))
*
gset bootres wstart wend = bootuv
*
forecast(model=tvar,from=wstart,to=wend,results=base)
compute ifill=0
dofor sign = 1 -1
dofor size = 1 2
compute ifill=ifill+1
do jshock=1,nvar
*
* Patch over the component for which are computing the
* response with the selected size and sign.
*
compute bootres(wstart)=bootuv(wstart)
compute bootres(wstart)(jshock)=sign*size
*
forecast(model=tvar,from=wstart,to=wend,results=withshock)
do i=1,nvar
[color=#0000FF]set girfs(ifill)(i,jshock) wstart wend = girfs(ifill)(i,jshock)+withshock(i)-base(i)[/color]
end do i
end do jshock
end do sign
end do size
end do krep
end do jrep
infobox(action=remove)
Please let me know if my question is not clear. Thank you so much if you could help on this part!!
Regards,
J
Re: Balke(2000) Threshold VAR
Dear Tom,
Following my previous post, I made some efforts in bookkeeping all simulated series for one GIRF series. And I did 1SD shock only.
However, I could only get girfsall(1)(i,jshock), i.e. the girf from the first draw.
It would be great to have you pointing out anything wrong.
Thank you,
J.J
Following my previous post, I made some efforts in bookkeeping all simulated series for one GIRF series. And I did 1SD shock only.
Code: Select all
* Set up target series. There is one for each combination of test sign
* and sizes on the shock, variable shocked and target variable.
*
*declare real size sign
*compute nexp=%size(shocksizes)*%size(shocksigns)
*display nexp
compute ndraws=100
dec vect[rect[series]] girfsall(ndraws)
do draw=1,ndraws
dim girfsall(draw)(nvar,nvar)
set girfsall(draw)(i,j) = 0.0
end do i
compute wstart=rstart, wend=rstart+horizon-1
infobox(action=define,lower=1,upper=ndraws,progress) "Bootstrapping Across Initial Values"
do jrep =1,nrep
infobox(current=jrep)
compute basedate = rdates(jrep)
do i=1, nvar
set depvars(i) wstart-maxlag wstart-1 =data(i)(t-wstart+basedate)
end do i
* Loop over bootstrap replications
*
do krep=1, nkrep
*Generate the bootstrap shuffle
boot rentries wstart wend rstart rend
*Generate the base set of shocks by premultiplying the bootstrapped
*standardized shocks by the factor of the overall coveriance.
gset bootuv wstart wend = %if(%ranflip(.5),+1,-1)*stdu(rentries(t))
gset bootres wstart wend = bootuv
forecast(model=tvar,from=wstart,to=wend,results=base)
do jshock=1,nvar
compute bootres(wstart)=bootuv(wstart)
[color=#0000FF]compute bootres(wstart)(jshock)=1[/color]
forecast(model=tvar,from=wstart,to=wend,results=withshock)
do i=1,nvar
set girfsall(krep)(i,jshock) wstart wend = girfsall(krep)(i,jshock)+withshock(i)-base(i)
end do i
end do jshock
end do krep
end do jrep
infobox(action=remove)
It would be great to have you pointing out anything wrong.
Thank you,
J.J
- Attachments
-
- tvarirf_rrg_fcst_ci.RPF
- try confidence band
- (9.09 KiB) Downloaded 1116 times
-
- rawdata6.csv
- data
- (43.02 KiB) Downloaded 1113 times
Re: Balke(2000) Threshold VAR
I'm not sure what you mean by "confidence band for this simulated series". The point estimates for the non-linear IRF's come from taking the average of the responses over a double loop of draws for initial conditions and bootstrapped residuals. That's necessary because the model is fundamentally non-linear. Other than the central measure (mean in particular), the statistics on those draws don't really have any meaning---they certainly don't correspond at all to the error bands from a linear model.
Re: Balke(2000) Threshold VAR
Dear Tom,
Another question:
If I set my shock size on var2 equals to 1, by the following code:
compute bootres(wstart)(jshock) = 1
BTW,
-why "1" means 1SD of var2?
-By full sample basic descriptive stat, for the var2, the mean is 0.00 and S.E. is 0.09. Does that mean " 1SD" shock to var2 is 9% increase in var2?
How can I explain the magnitudes of GIRF output?
For example, I got the GIRF of var5 to 1SD shock var2 is
Horizon GIRF
1 0.006
2 0.004
3 0.002
Can I say 1SD shock on var2 cause 0.6% increase on var5, contemporaneously? (Does that mean 9% increase in var2 cause 0.6% increase in var5?)
Thank you,
J.J
Another question:
If I set my shock size on var2 equals to 1, by the following code:
compute bootres(wstart)(jshock) = 1
BTW,
-why "1" means 1SD of var2?
-By full sample basic descriptive stat, for the var2, the mean is 0.00 and S.E. is 0.09. Does that mean " 1SD" shock to var2 is 9% increase in var2?
How can I explain the magnitudes of GIRF output?
For example, I got the GIRF of var5 to 1SD shock var2 is
Horizon GIRF
1 0.006
2 0.004
3 0.002
Can I say 1SD shock on var2 cause 0.6% increase on var5, contemporaneously? (Does that mean 9% increase in var2 cause 0.6% increase in var5?)
Thank you,
J.J
Re: Balke(2000) Threshold VAR
It means 1 s.d. based upon the shocks in that branch of the model. The sample statistics are irrelevant.
You can't scale responses in a non-linear model. That's why 1 s.d. ,-1 s.d., 2 s.d. and -2 s.d. are computed separately.
You can't scale responses in a non-linear model. That's why 1 s.d. ,-1 s.d., 2 s.d. and -2 s.d. are computed separately.
Re: Balke(2000) Threshold VAR
Hi Tom ,
Thanks for sharing the replication materials.
I am running the program using my data. The program appears to working as expected to create the threshold value and the IRF for the upper regime . However when I try to switch the command " comp upper =0" to estimate the lower regime ( i.e., normal regime in the paper of Balke" , I am receiving an error message. Please note that when I reduce my model to 3 var instead of my 4 variable model I do get some IRF plot. I am not sure what is causing that ?
I would appreciate your advice/suggested edits ( I am attaching my programs) .
Thanks in advance
Thanks for sharing the replication materials.
I am running the program using my data. The program appears to working as expected to create the threshold value and the IRF for the upper regime . However when I try to switch the command " comp upper =0" to estimate the lower regime ( i.e., normal regime in the paper of Balke" , I am receiving an error message. Please note that when I reduce my model to 3 var instead of my 4 variable model I do get some IRF plot. I am not sure what is causing that ?
I would appreciate your advice/suggested edits ( I am attaching my programs) .
Thanks in advance
- Attachments
-
- Bach_tvar_irf.rpf
- (9.15 KiB) Downloaded 1087 times
-
- FISCAL.xlsx
- (12.45 KiB) Downloaded 894 times
-
- Bach_tvar_estimate.rpf
- (3.73 KiB) Downloaded 1133 times
Re: Balke(2000) Threshold VAR
Your R and INVES series are missing the 2000:3 data point, so your entire range for estimation and bootstrapping needs to be shifted up an entry.
Re: Balke(2000) Threshold VAR
Dear Tom,
I notice in the tvar_estimate.rpf , it is using loglikelihood ratio(LR) test for the non-linearity test and threshold value search. I wonder whether there is existing literature that also follow this approach in this step? I believe it is valid
, as many other nonlinearity tests and the WALD tests in Balke(2000). I just didn't find others did it, though most use Balke(2000) or Tsay(1989), etc.
Best,
J
I notice in the tvar_estimate.rpf , it is using loglikelihood ratio(LR) test for the non-linearity test and threshold value search. I wonder whether there is existing literature that also follow this approach in this step? I believe it is valid
Best,
J
Re: Balke(2000) Threshold VAR
I'm very confused about what you're saying. It uses the likelihood ratio, but uses the fixed regressor bootstrap to evaluate the significance level since the standard asymptotics don't apply. The fixed regressor bootstrap is from Bruce Hansen's work, and is used in some of his other papers such as Hansen and Seo(2002), which is also included with RATS (though it's quite a bit different application that the threshold VAR).
Re: Balke(2000) Threshold VAR
Thanks Tom,
Do I understand correctly that test built into the shared program for the threshold identification has its Ho = "non-linearity assumption" as opposed to Tsay 's H0 = "Linearity".
Thanks
Do I understand correctly that test built into the shared program for the threshold identification has its Ho = "non-linearity assumption" as opposed to Tsay 's H0 = "Linearity".
Thanks
Re: Balke(2000) Threshold VAR
No. The null is linearity (i.e. no threshold).
Re: Balke(2000) Threshold VAR
Thanks Tom,
In this case, is there a reason why when we run the replication materials for Balke (2000) to estimate threshold test , all values ( Sup, Avg, and EXP) have a P-Value > 0.1 , which I interpret as I can not reject the H0. Am I missing something ?
Thanks
In this case, is there a reason why when we run the replication materials for Balke (2000) to estimate threshold test , all values ( Sup, Avg, and EXP) have a P-Value > 0.1 , which I interpret as I can not reject the H0. Am I missing something ?
Thanks