var C C_h C_f B_f W N N_h N_f lamb vlam Z K Y lamb1 Y_f K_f W_f m_f mc d_p pistar pi x1 x2 Q I I_f n e d d_f R R_f R_l Miu Miu_d v Ome x Phi loan EX x_f a a_f tau_N tau_Df Rh_f GDP; varexo e_r e_a e_af e_f e_xf e_mf; parameters Beta Phi_c Phi_L Phi_n Eta sigma Alpha_h Alpha_f Phi_p Thea_m Phi_I Psim Psif tau_b tau_k Delta Thea Gama Xi Gama_c Eta_f Thea1 Thea2 Thea3 w_b Psi_f rhor rhoa rhoaf rhof rhoxf; Beta=0.985; Phi_c=0.75; Phi_L=2; Phi_n=0.8; Eta=2; sigma=0.94; Alpha_h=0.5; Alpha_f=0.5; Phi_p=5; Thea_m=0.75; Phi_I=1; Psim=5; Psif=5; tau_b=5; tau_k=5; Delta=0.025; Thea=1.446728127; Gama=4.986698014; Xi=0.002976317; Gama_c=0.5; Eta_f=1; Thea1=0.25; Thea2=0.25; Thea3=0.25; w_b=1; Psi_f=0.2; rhor=0.8; rhoa=0.8; rhoaf=0.8; rhof=0.8; rhoxf=0.8; model; lamb*(e^(1-Gama_c))=1/(C-Phi_c*C(-1))-Beta*Phi_c/(C(+1)-Phi_c*C); lamb*W=Phi_L*(N^(Eta-Phi_n))*(N_h^Phi_n); lamb*W_f=Phi_L*(N^(Eta-Phi_n))*(N_f^Phi_n); Beta*vlam*R/pi(+1)=1; Beta*vlam*(e(+1)/e)*Rh_f=1; Rh_f=R_f*(exp(-Psif*B_f)); vlam=lamb(+1)/lamb; C=(((Gama_c^Gama_c)*((1-Gama_c)^(1-Gama_c)))^(-1))*(C_h^(Gama_c))*((C_f)^(1-Gama_c)); N=((N_h^(1+Phi_n))+N_f^(1+Phi_n))^(1/(1+Phi_n)); Q(-1)*R_f(-1)*e/e(-1)=lamb1*a_f*Alpha_f*(K_f(-1)^(Alpha_f-1))*(N_f^(1-Alpha_f))+(1-Delta)*Q-Psim*(K_f(-1)-0.462478534); W_f=lamb1*a_f*(1-Alpha_f)*(K_f(-1)^(Alpha_f))*(N_f^(-Alpha_f)); Y_f=a_f*(K_f(-1)^Alpha_f)*(N_f^(1-Alpha_f)); K_f=(1-Delta)*K_f(-1)+I_f; (lamb1^(1/Alpha_f))*(((1-Alpha_f)/W_f)^(1/Alpha_f-1))*(a_f^(1/Alpha_f))*Alpha_f=Q(-1)*R_f(-1)*e/e(-1)-(1-Delta)*Q+Psim*(K_f(-1)-0.462478534); mc=((1-Alpha_h)^(Alpha_h-1))*(Z^Alpha_h)/(a*(Alpha_h^Alpha_h)*(W^(Alpha_h-1))); Z=Alpha_h*mc*a*(K^(Alpha_h-1))*(N_h^(1-Alpha_h)); W=(1-Alpha_h)*mc*a*(K^Alpha_h)*(N_h^(-Alpha_h)); 1/Q=1-(Phi_I/2)*(I/I(-1)-1)^2-Phi_I*(I/I(-1)-1)*I/I(-1)+Beta*vlam*Phi_I*(I(+1)/I-1)*((I(+1)/I)^2)*Q(+1)/Q; K(+1)=(1-Delta)*K+(1-(Phi_I/2)*(I/I(-1)-1)^2)*I; R_l=(Z+(1-Delta)*Q(+1))/Q; pistar=pi*(Phi_p/(Phi_p-1))*x1/x2; x1=lamb*mc*Y+Beta*Thea_m*x1(+1)*pi(+1)^Phi_p; x2=lamb*Y+Beta*Thea_m*x2(+1)*pi(+1)^(Phi_p-1); pi^(1-Phi_p)=Thea_m+(1-Thea_m)*(pistar^(1-Phi_p)); d_p=(1-Thea_m)*(pistar^(-Phi_p))*(pi^Phi_p)+Thea_m*(pi^Phi_p)*d_p(-1); Y=a*(K^Alpha_h)*(N_h^(1-Alpha_h))/d_p; loan=(1+tau_N)*n+(1-tau_Df)*e*d_f+d; tau_N*n=tau_Df*e*d_f; Phi=loan/n; x=e*d_f/(loan); Phi=v/(Thea*(1+(Gama/2)*(x^2))-(Miu+Miu_d*x)); v=Beta*vlam(+1)*Ome(+1)*(R/pi(+1))*(1+tau_N); Miu=Beta*vlam(+1)*Ome(+1)*(R_l(+1)-R/pi(+1)); Miu_d=Beta*vlam(+1)*Ome(+1)*((1-tau_Df)*R/pi(+1)-R_f*e(+1)/e); Ome=1-sigma+sigma*Thea*(1+Gama*(x^2)/2)*Phi; x=(Miu/Miu_d)*(((1+(2/Gama)*((Miu_d/Miu)^2))^(1/2))-1); n=(sigma+Xi)*R_l*loan(-1)-sigma*R(-1)*d(-1)/pi-sigma*e*R_f(-1)*d_f(-1); tau_Df=w_b*log(loan/27.39034824); loan=Q*K(+1); EX=(e^Eta_f)*x_f; Y=C_h+EX+I+(Phi_I/2)*((I/I(-1)-1)^2)*I; Q*K_f-(1-Delta)*Q*K_f(-1)+e*(B_f-Rh_f(-1)*B_f(-1))+e*(d_f-R_f(-1)*d_f(-1))=e*C_f-Y_f-EX; GDP=Y+Y_f; log(m_f/1.940663537)=Psi_f*log(m_f(-1)/1.940663537)+e_mf; log(R/1.015228426)=rhor*log(R(-1)/1.015228426)+(1-rhor)*(0.32*log(Y/4.124193932)+0.67*log(pi/1)+0.93*log(e/1.649700371))+e_r; log(a/1)=rhoa*log(a(-1)/1)+e_a; log(a_f/1)=rhoaf*log(a_f(-1)/1)+e_af; log(R_f/1.005)=rhof*log(R_f(-1)/1.005)+e_f; log(x_f/1)=rhoxf*log(x_f(-1)/1)+e_xf; end; initval; C=2.78686644; C_h=1.789734855; C_f=1.084884799; B_f=-0.002015; W=2.656552887; N=0.623880371; N_h=0.620984277; N_f=0.043671626; lamb=0.291942686; vlam=1; R=1.015228426; Rh_f=1.015228426; Z=0.060228426; K=27.39034824; Y=4.124193932; lamb1=0.19525284; Y_f=0.142116817; K_f=0.462478534; W_f=0.317697262; m_f=1.940663537; mc=0.8; pistar=1; d_p=1; pi=1; x1=3.686976466; x2=4.608720583; Q=1; I=0.684758706; I_f=0.011561963; n=13.69517412; e=1.649700371; d=10.9561393; d_f=1.660322609; R_f=1.005; R_l=1.035228426; Miu=0.056098985; Miu_d=0.028690217; v=2.847664203; Ome=2.847664203; x=0.1; Phi=2; loan=27.39034824; EX=1.649700371; GDP=4.263183016; x_f=1; a=1; a_f=1; tau_N=0; tau_Df=0; end; steady; check; model_info; model_diagnostics; check; shocks; var e_f; stderr 1; end; stoch_simul(order=1, periods=0,irf=100,conditional_variance_decomposition =[1:50]);