Dear Professor,
Thank you for your helpful advice. I checked my model again.
I found a mistake in my model and corrected it , but a new problem emerged. The variables did not converge until after about 20,000 period. price P PH PL looks like straight lines and converge until after about 20,000 period. I couldn’t fix it . I am sorry but could you give me some suggestions or directions to try?
Best regards,
Var Y YH YL C ph pl wh wl LAMNR LAMR CR LR LRH LRL D CNR LNR LNRH LNRL LH LL KH KL KP IP Q RK WH WL PH PL P PI DX Z BH CEH TCREH TCCEH INH QU X T G IG KG TRANS tau_cr tau_cnr tau_l tau_k tau_eh tau_el tau_x RR RD RH RL RF F HH HL H HR theta theta2 M AH AL SG SIG Stau_cr Stau_cnr Stau_k Stau_l Stau_x Stau_eh Stau_el STRANS ;
Varexo e_H e_L e_G e_IG e_tau_cr e_tau_cnr e_tau_l e_tau_k e_tau_eh e_tau_el e_BH e_M e_RR e_F e_tau_x e_TRANS;
Parameters theta2ss ksi rhoF rhoBH s sigma phic phi rho1 rho2 beta delta deltaG chi epsilon omega omegaR alpha1 alpha2 alpha3 beta1 beta2 epsilon2 epsilon1 d0 d1 d2 rho eta tau_crss tau_cnrss tau_lss tau_kss tau_ehss tau_elss tau_xss QUBAR phiIGss phiTRANSss TRANSss PHss PLss Pss ALss AHss RKss Yss YHss KHss LHss WHss WLss Zss CEHss TCREHss YLss KLss IGss KGss LLss KPss IPss Xss QUss DXss Css CRss CNRss LRss LNRss LRHss LRLss LNRHss LNRLss Tss Gss LAMNRss LAMRss Qss IHss ILss gammaG gammaIG phiG gammatau_cr gammatau_cnr gammatau_l gammatau_k gammatau_eh gammatau_el gammatau_x gammaR gammaY gammaPI rhoAL rhoAH rhoG rhoIG rhotau_cr rhotau_cnr rhotau_k rhotau_x rhotau_l rhotau_eh rhotau_el rhoM rhoRR rhoTRANS gammaTRANS phiIG phiTRANS shareKss shareLss INRss INNRss RRss RHss RLss RDss HHss HLss Hss HRss RFss Fss Mss thetass Dss BHss;
gammatau_cr = 0.7;
gammatau_cnr = 0.7;
gammatau_k = 0.7;
gammatau_l = 0.7;
gammatau_eh = 0.7;
gammatau_el = 0.7;
gammatau_x = 0.7;
gammaG = 0.3956;
gammaIG = 0.3753 ;
phiG = 0.3208;
phiIG =0.2529;
phiTRANS=0.3207;
gammaR = 0.718;
gammaY = 0.1185;
gammaPI = 1.0473;
rhoAL=0.9;
rhoAH=0.9;
rhoBH=0.9;
rhoG =0.9;
rhoIG =0.9;
rhoRR =0.9;
rhoM =0.9;
rhoF =0.9;
rhotau_cr= 0.7;
rhotau_cnr= 0.7;
rhotau_k= 0.7;
rhotau_l = 0.7;
rhotau_eh = 0.7;
rhotau_el = 0.7;
rhotau_x=0.9;
rhom=0.9;
rhoTRANS=0.7032;
gammaTRANS = 0.3621;
load '_paramc48.mat';
set_param_value('sigma',sigma);
set_param_value('phic',phic);
set_param_value('phi',phi);
set_param_value('rho1',rho1);
set_param_value('rho2',rho2);
set_param_value('beta',beta);
set_param_value('delta',delta);
set_param_value('deltaG',deltaG);
set_param_value('chi',chi);
set_param_value('epsilon',epsilon);
set_param_value('omega',omega);
set_param_value('omegaR',omegaR);
set_param_value('beta2',beta2);
set_param_value('beta1',beta1);
set_param_value('alpha3',alpha3);
set_param_value('alpha2',alpha2);
set_param_value('alpha1',alpha1);
set_param_value('epsilon2',epsilon2);
set_param_value('epsilon1',epsilon1);
set_param_value('rho',rho);
set_param_value('eta',eta);
set_param_value('d0',d0);
set_param_value('d1',d1);
set_param_value('d2',d2);
set_param_value('QUBAR',QUBAR);
set_param_value('tau_crss',tau_crss);
set_param_value('tau_cnrss',tau_cnrss);
set_param_value('tau_lss',tau_lss);
set_param_value('tau_kss',tau_kss);
set_param_value('tau_ehss',tau_ehss);
set_param_value('tau_elss',tau_elss);
set_param_value('tau_xss',tau_xss);
set_param_value('phiIGss',phiIGss);
set_param_value('phiTRANSss',phiTRANSss);
set_param_value('TRANSss',TRANSss);
set_param_value('PHss',PHss);
set_param_value('PLss',PLss);
set_param_value('Pss',Pss);
set_param_value('ALss',ALss);
set_param_value('AHss',AHss);
set_param_value('RKss',RKss);
set_param_value('Yss',Yss);
set_param_value('YHss',YHss);
set_param_value('KHss',KHss);
set_param_value('LHss',LHss);
set_param_value('Zss',Zss);
set_param_value('CEHss',CEHss);
set_param_value('TCREHss',TCREHss);
set_param_value('YLss',YLss);
set_param_value('KLss',KLss);
set_param_value('IGss',IGss);
set_param_value('KGss',KGss);
set_param_value('LLss',LLss);
set_param_value('WHss',WHss);
set_param_value('WLss',WLss);
set_param_value('KPss',KPss);
set_param_value('IPss',IPss);
set_param_value('Dss',Dss);
set_param_value('Xss',Xss);
set_param_value('QUss',QUss);
set_param_value('DXss',DXss);
set_param_value('Css',Css);
set_param_value('CNRss',CNRss);
set_param_value('CRss',CRss);
set_param_value('LNRss',LNRss);
set_param_value('LRss',LRss);
set_param_value('LNRHss',LNRHss);
set_param_value('LRHss',LRHss);
set_param_value('LNRLss',LNRLss);
set_param_value('LRLss',LRLss);
set_param_value('Tss',Tss);
set_param_value('Gss',Gss);
set_param_value('LAMRss',LAMRss);
set_param_value('LAMNRss',LAMNRss);
set_param_value('Qss',Qss);
set_param_value('IHss',IHss);
set_param_value('ILss',ILss);
set_param_value('shareKss',shareKss);
set_param_value('shareLss',shareLss);
set_param_value('INRss',INRss);
set_param_value('INNRss',INNRss);
set_param_value('RRss',RRss);
set_param_value('RHss',RHss);
set_param_value('RLss',RLss);
set_param_value('RFss',RFss);
set_param_value('RDss',RDss);
set_param_value('HLss',HLss);
set_param_value('HHss',HHss);
set_param_value('Hss',Hss);
set_param_value('HRss',HRss);
set_param_value('Mss',Mss);
set_param_value('Fss',Fss);
set_param_value('thetass',thetass);
set_param_value('s',s);
set_param_value('ksi',ksi);
set_param_value('BHss',BHss);
set_param_value('theta2ss',theta2ss);
model(linear);
//1-1 CR
LAMR+ P +(tau_crss/(1+tau_crss))*tau_cr=(phic*(1-sigma)-1)*CR+(1-phic)*(1-sigma)*QU(-1);
//1-2 LRH
(phi-rho1)*LR+rho1*LRH=WH+LAMR-(tau_lss*tau_l)/(1-tau_lss);
//1- 3LRL
(phi-rho1)*LR+rho1*LRL=WL+LAMR-(tau_lss*tau_l)/(1-tau_lss);
//1-4 LR
(LRss^(1+rho1))*LR=(LRHss^(1+rho1))*LRH+(LRLss^(1+rho1))*LRL;
//1-5 LAM
LAMR(+1)=LAMR-RD;
//1-6 Q
(Qss/beta)*Q = (1-delta)*Qss*Q(+1)+LAMRss*RKss*(1-tau_kss)*(LAMR(+1)+RK(+1)-(tau_kss/(1-tau_kss))*tau_k(+1));
//1-7 IP
(1+tau_crss)*LAMRss*Pss*(LAMR+P+(tau_crss/(1+tau_crss))*tau_cr)-Qss*Q+chi*Qss*(IP-IP(-1))=chi*beta*Qss*(IP(+1)-IP);
//1-8 KP
KP = (1-delta)*KP(-1) + delta*IP;
//1-9 CNR
LAMNR+ P +(tau_cnrss/(1+tau_cnrss))*tau_cnr=(phic*(1-sigma)-1)*CNR+(1-phic)*(1-sigma)*QU(-1);
//LAMNR(+1)+ P(+1) +(tau_cnrss/(1+tau_cnrss))*tau_cnr(+1)=(phic*(1-sigma)-1)*CNR(+1)+(1-phic)*(1-sigma)*QU;
//1-10 LNRH
(phi-rho2)*LNR+rho2*LNRH=WH+LAMNR-(tau_lss*tau_l)/(1-tau_lss);
//1-11 LNRL
(phi-rho2)*LNR+rho2*LNRL=WL+LAMNR-(tau_lss*tau_l)/(1-tau_lss);
//1-12 LNR
(LNRss^(1+rho2))*LNR=(LNRHss^(1+rho2))*LNRH+(LNRLss^(1+rho2))*LNRL;
//1-13 LAMNR
Pss*CNRss*((P+CNR)*(1+tau_cnrss)+tau_cnrss*tau_cnr) = WHss*LNRHss *((WH+LNRH)*(1-tau_lss)-tau_lss*tau_l)+WLss*LNRLss*((WL+LNRL)*(1-tau_lss)-tau_lss*tau_l)+Pss*TRANSss*(P+TRANS);
//1-14 C
Css*C = omegaR*CRss*CR + (1-omegaR)*CNRss*CNR;
// 1-15 WH
LHss*LH = omegaR*LRHss*LRH + (1-omegaR)*LNRHss*LNRH;
// 1-16 WL
LLss*LL = omegaR*LRLss*LRL + (1-omegaR)*LNRLss*LNRL;
//1-17 RK
KPss*KP=KHss*KH+KLss*KL;
//2-1 YL demand – PL--18
YL+epsilon*PL=epsilon*P+Y;
//2-2 YH demand –PH--19
YH+epsilon*PH=epsilon*P+Y;
//2-3 P--20
(Pss^(1-epsilon))*P=omega*(PLss^(1-epsilon))*PL+(1-omega)*(PHss^(1-epsilon))*PH;
//2-4 PI---21
PI=P-P(-1);
//2-5 DX
DXss*DX=d1*Xss*X+2*d2*(Xss^2)*X;
//2-6—
Yss*Y= Css*C + IPss*IP+IGss*IG + Gss*G+(TCREHss/Pss)*(TCREH-P);
//Pss*Yss*(Y+P)= PHss*YHss*(YH+PH)+PLss*YLss*(YL+PL);
//3-1 YL--24
YL=AL+alpha1*KL(-1)+alpha2*LL+alpha3*KG(-1)-(DXss*DX)/(1-DXss);
//3-2 HL
HLss*HL=WLss*LLss*(WL+LL)+RKss*KLss*(RK+KL(-1));
//3-3 RF
RFss*RF=RLss*RL-Fss*F;
//3-4 trade-off LL—27
PL-(DXss*DX)/(1-DXss)-(tau_elss*tau_el)/(1-tau_elss)=RF-AL-alpha3*KG(-1)+alpha1*RK+alpha2*WL;
LL-KL(-1)=RK-WL;
//4-1 YH--29
YH=AH+beta1*KH(-1)+beta2*LH-(DXss*DX)/(1-DXss);
//4-2 HH--30
HHss*HH=WHss*LHss*(WH+LH)+RKss*KHss*(RK+KH(-1));
//4-3 trade-off LH–31
WH-RK=KH(-1)-LH;
(1-tau_ehss)*(1-DXss)*PHss*PH-(1-tau_ehss)*DXss*PHss*DX-tau_ehss*PHss*(1-DXss)*tau_eh-((tau_xss*(1-Zss)*rho*(1-DXss))/BHss)*(tau_x-BH)+((tau_xss*(1-Zss)*rho*DXss)/BHss)*DX+((tau_xss*Zss*rho*(1-DXss))/BHss)*Z-epsilon1*(Zss^epsilon2)*epsilon2*(1-DXss)*Z+epsilon1*(Zss^epsilon2)*DXss*DX=((RHss/AHss)*((RKss/beta1)^beta1)*((WHss/beta2)^beta2))*(RH-AH+beta1*RK+beta2*WH);
//4-5 CEH --33
CEH+BH=YH-(Zss*Z)/(1-Zss);
//4-6 Z--34
(epsilon2-1)*Z= tau_x -BH;
//4-7-- TCREH-35
TCREH= epsilon2*Z +YH;
//4-8 INH
INH=CEH-YH;
//4-9TCCEH--37
TCCEH=tau_x+CEH;
//4-10 X--38
Xss*X=(1-eta)*Xss*X(-1)+CEHss*CEH;
//4-11 QU--39
QUss*QU=-Xss*X;
//QUss*QU=(1-eta)*QUss*QU(-1)-CEHss*CEH;
//QUss*QU(+1)=(1-eta)*QUss*QU-CEHss*CEH;
//5-1
Hss*H=HLss*HL+HHss*HH;
//5-2
Hss*H=(1-s)*Dss*D+HRss*HR;
//5-3 HR 42
HR=M+HL;
//5-4 RH 43
RHss*RH=thetass*theta;
//5-5 RL 44
//RLss*RL=thetass*theta+RRss*Mss*(RR+M)-Mss*M-thetass*Mss*(theta+M);
RLss*RL=thetass*theta- theta2ss*Mss*(theta2+M);
//5-6 RD
RDss*RD=(1-s)*thetass*theta;
//
RR*RRss=thetass*theta-theta2ss*theta2;
Tss*T = Pss*Gss*(P+G) + Pss*IGss*(P+IG) + +Pss*TRANSss*(P+TRANS)+Fss*HLss*(F+HL);
//6-2 T
Tss*T= omegaR*tau_crss*Pss*CRss*(tau_cr+CR+P)+ tau_crss*Pss*IPss*(tau_cr+P+IP)+ (1-omegaR)*tau_cnrss*Pss*CNRss*(tau_cnr+CNR+P)+ tau_lss*WHss*LHss*(tau_l+WH+LH)+ tau_lss*WLss*LLss*(tau_l+WL+LL)+ tau_kss*RKss*KPss*(tau_k+RK+KP(-1))++tau_ehss*PHss*YHss*(tau_eh+PH+YH)+tau_elss*PLss*YLss*(tau_el+PL+YL)+tau_xss*CEHss*(tau_x+CEH);
//6-3 KG
KG = (1-deltaG)*KG(-1) + deltaG*IG;
//6-4
G = -gammaG*Y(-1) +SG;
//6-5-
TRANS = -gammaTRANS*Y(-1) +STRANS;
//6-6 IG
IG = -gammaIG*Y(-1) +SIG;
//5-6- tau_c
tau_cr = gammatau_cr*tau_cr(-1)+Stau_cr;
tau_cnr = gammatau_cnr*tau_cnr(-1)+Stau_cnr;
//5-7- tau_l
tau_l = gammatau_l*tau_l(-1) +Stau_l;
//5-8- tau_k
tau_k = gammatau_k*tau_k(-1) +Stau_k;
//5-9- tau_e
tau_eh = gammatau_eh*tau_eh(-1) + Stau_eh;
tau_el = gammatau_el*tau_el(-1) + Stau_el;
//5-10 tau_x
tau_x = gammatau_x*tau_x(-1) +Stau_x;
M=rhoM*M(-1)+e_M;
RR=rhoRR*RR(-1)-e_RR;
F=rhoF*F(-1)+e_F;
//6-1 AH
AH = rhoAH*AH(-1)+e_H;
//6-2 AL
AL = rhoAL*AL(-1)+e_L;
BH= rhoBH*BH(-1)+e_BH;
//6-3- SG
SG = rhoG*SG(-1) + e_G;
SIG = rhoIG*SIG(-1) + e_IG;
//6-4 Stau_c
Stau_cr = rhotau_cr*Stau_cr(-1) + e_tau_cr;
Stau_cnr = rhotau_cnr*Stau_cnr(-1) - e_tau_cnr;
//6-5- Stau_l
Stau_l = rhotau_l*Stau_l(-1) - e_tau_l;
//6-6 - Stau_k
Stau_k = rhotau_k*Stau_k(-1) + e_tau_k;
//6-7- Stau_e
Stau_eh = rhotau_eh*Stau_eh(-1) - e_tau_eh;
Stau_el = rhotau_el*Stau_el(-1) -e_tau_el;
//6-8- Stau_x
Stau_x = rhotau_x*Stau_x(-1) + e_tau_x;
//33 - Shock in Transfer of Income
STRANS = rhoTRANS*STRANS(-1) + e_TRANS;
ph=PH-P;
pl=PL-P;
wh=WH-P;
wl=WL-P;
end;
resid(1);
steady;
model_diagnostics;
check(qz_zero_threshold=1e-20);
shocks;
//var e_H; stderr 0.05;
//
var e_L; stderr 0.05;
//var e_BH; stderr 0.05;
//var e_tau_x; stderr 0.1;
//var e_IG; stderr 0.01;
//var e_tau_el; stderr 0.01;
//var e_F; stderr 0.01;
//var e_RR; stderr 0.01;
//var e_M; stderr 0.01;
//var e_G; stderr 0.05;
//var e_TRANS; stderr 0.05;
//var e_tau_cnr; stderr 0.01;
//var e_tau_l; stderr 0.01;
//var e_tau_k; stderr 0.01;
end;
stoch_simul(periods=1000,qz_zero_threshold=1e-20,irf=100)
AH AL Y YH YL P PH PL ph pl wh wl CR CNR LH LL LRH LRL KG WH WL IG IP KP KH KL RK X CEH DX T F TRANS ;