var c r r_f w v l k i y a b d g tb nd ; /* c : consumption of the representative household */ /* r the interest rate on the government debt (per quarter) */ /* r_f the external debt interest rate (per quarter) */ /* w the wage */ /* v the return on capital (rental rate) */ /* l, k, i, y, a as usual */ /* b the external debt */ /* g the public expenditures */ /* tb the trade balance */ /* nd the government balance */ varexo mi ni ; /* ni is the shock on the public expenditures */ /* mi on the technology */ parameters bet del rho1 rho2 mu gamma fi theta omega psi tau dpib T pie iota gpib tbpib zita gbar; /* del is the depreciation per quarter */ del=.025 ; /* bet the discount rate, that is equal at the ss to 1/(1+r_f) with r_f the external debt interest rate per quarter */ bet=1/1.01375 ; /* rho1 the persistance of techno shocks and rho2 the persistance of fiscal shocks */ rho1=.904 ; rho2=.914 ; /* mu the tax rate */ mu=0.065 ; /* gamma is the risk aversion */ gamma=2 ; /* capital adjustment cost parameter */ fi=.028 ; /* theta is the capital share in ouput */ theta = .32 ; /* omega is the world interest rate per quarter */ omega=.01375 ; /* psi is the debt elasticity of the country specific risk premium 5Schmitt-Grohé & Uribe */ psi=.000742 ; /* tau is the income tax rate */ tau=.33; /* dpib is the ss value of the government debt to output */ dpib=.57; /* T are transfers, which satisfies the ss values of dpib, gpib and tau*y(steadystate) */ T=(-0.01375)*(0.57*0.52836531)-0.2*0.52836531+0.33*0.52836531; /* pie is th curvature parameter in labour (same as Mendoza, 1991) */ pie = 1.445 ; /* iota is the labour coefficient set so the labour is equal to 0.2 at the ss */ iota=1.64 ; /* gpib is is the ss value of the government expenditures to output */ gpib=0.2; /* tbpib is the ss value of the trade balance to output */ tbpib=.03; /* zita is the level of external debt at the ss, ie =tbpib*y(steadystate)/(worldinterestrate) */ zita=0.52836531*(0.03)/0.01375; /* gbar is the mean level of public expenditures = public expenditures at the SS */ gbar=0.2*0.52836531; end; model; (c-(iota*l^(pie)))^(-gamma)=bet*(1+r_f)*((c(1)-iota*l(1)^pie)^(-gamma)); iota*pie*l^(pie-1)=(1-tau)*w; w=a*(k/l)^(theta)*(1-theta); v=theta*a*(l/k)^(1-theta); r_f=omega+psi*(exp(b-zita)-1); y=a*(k^theta)*(l^(1-theta)); log(g)=(1-rho2)*log(gbar)+rho2*log(g(-1))+ni; log(a)=rho1*log(a(-1))+mi; r=r_f+mu; y=c+i+g+fi*(k(1)-k)+tb; 1+r-mu=1+(1-tau)*v(1)-del+fi*(k(2)-k(1)); i=k(1)-(1-del)*k; b=(1+r_f(-1))*b(-1)+c+i+d+((fi^2)/2)*(k(1)-k)+tau*y+mu*d-w*l-T-v*k-(1+r(-1))*d(-1); d=(1+r(-1))*d(-1)+T+g-tau*y-mu*d(-1); nd=d(-1)-d; end; steady_state_model; a=1; r_f=omega; r=r_f+mu; v=(omega+del)/(1-tau); w=(1-theta)*(v/theta)^(theta/(theta-1)); l=(((1-tau)*w)/(iota*pie))^(1/(pie-1)); k=((w*l^(theta))/(1-theta))^(1/theta); y=k^(theta)*l^(1-theta); i=del*k; g=gpib*y; tb=tbpib*y; d=(tau*y-T-g)/(r-mu); b=tbpib*y/omega; c=y-i-g-tb; nd=0; end; steady; shocks; var mi; stderr .009; end; resid; check; //options_.loglinear=1; stoch_simul(order=2, periods=1000); //stoch_simul(order2, periods=1000, irf=30, hp_filter=1600); return stoch_simul(irf=30); //return