Here is a perhaps simpler one. Dataset attached. Two variables, Corporate Tax Return Audit Rate (Corp_a) and Unreported AGI/Reported AGI(UAG_RAG). My goal is to show a plot of UAG_RAG responding to a negative shock to Corp_a. In the VECM for the below-threshold ECT is statistically significant suggesting that UAG responds to below-threshold deviations from equilibrium.
I am getting the following error:
Forecast for DCORP_A solves to NA at 2010:01, on iteration 1
Forecast for DUAG_RAG solves to NA at 2010:01, on iteration 1...
Code: Select all
linreg uag_rag / U
# constant corp_a
*
set du = u-u{1}
*
linreg(title="Engle-Granger Auxiliary Regression") du
# u{1} du{1}
set tseries = u{1}
@EndersSiklos(title="TAR with Empirical Threshold", threshold=tseries, pi=.10, lags=1) u
set mt1 = %if(u{1}>=%%breakvalue,1,0)
set mt2 = 1-mt1
set z1 = mt1*u{1}
set z2 = mt2*u{1}
**z1 and z2, the two error correction terms are lagged above***
linreg du
# z1 z2 du{1}
set dcorpplus = %max(dcorp_a,0)
set dcorpminus = %min(dcorp_a,0)
set duag_ragplus = %max(duag_rag,0)
set duag_ragminus = %min(duag_rag,0)
system(model=tvecm)
variables dcorp_a duag_rag
det dcorpplus{1} dcorpminus{1} duag_ragplus{1} duag_ragminus{1} z1 z2
end(system)
*
estimate
frml(identity) duageq uag_rag = uag_rag{1}+duag_rag
frml(identity) duag_ragpluseq duag_ragplus = %max(duag_rag,0)
frml(identity) duag_ragminuseq duag_ragminus = %min(duag_rag,0)
*
frml(identity) corpeq corp_a = corp_a{1}+dcorp_a
frml(identity) dcorp_apluseq duplus = %max(dcorp_a,0)
frml(identity) dcorp_aminuseq duminus = %min(dcorp_a,0)
*
frml(identity) zpluseq zplus = z1
frml(identity) zminuseq zminus = z2
*
group identities duageq corpeq duag_ragpluseq duag_ragminuseq $
dcorp_apluseq dcorp_aminuseq
*
compute fstart=%regend(),fend=fstart+9
forecast(model=tvecm+identities,results=baseresults,steps=10)
* Do Choleski factor
*
compute fsigma=%decomp(%sigma)
*
* Do responses with + and - shocks to IM
*
forecast(model=tvecm+identities,shocks = %xcol(fsigma,1),results=withplus,steps=10)
forecast(model=tvecm+identities,shocks = -1.0*%xcol(fsigma,1),results=withminus,steps=10)
*
* Take gap between the forecasts to get the IRF's
****Would the response OF UAG below be 3 or 4?***
set ircorpplus fstart fend = withplus(3)-baseresults(3)
set irfcorpminus fstart fend = withminus(3)-baseresults(3)