%SP_RUN.M % This program produces impulse responses in an RBC model with good-specific subsistence points (see ``The Macroeconomics of Subsistece Points,'' by M. Ravn, S. Schmitt-Grohe, and M. Uribe) % %(c) Stephanie Schmitt-Grohe and Martin Uribe % %Date 31-Oct-2004 %SHOCKS %shock=1 preference %shock=2 government %shock=3 technology for shock=1:3 %Compute analytical derivatives of equilibrium conditions [fx,fxp,fy,fyp,f] = sp; %Numerical evaluation %Assign values to parameters and steady-state variables [ THETA,GBAR,SIGMA,CHI,GAMA,BETTA,DELTA,ALFA,ETA,CSTAR,IVSTAR,GSTAR,RHOZ,RHOG,RHOV,w,h,c,u,k,iv,mu,a,g,v,output,wp,hp,cp,up,kp,ivp,mup,ap,gp,vp,outputp,W,H,C,U,K,IV,MU,A,G,V,OUTPUT,PHI,EHW,SC,SG,SI,THETA_C,THETA_G,THETA_I]=sp_ss(0.3,0.3,0.3); %the numbers in parenthesis correspond to (theta_c,theta_g,theta_i) %For the paper ``The Macroeconomics of Subsistence Points,'' replace the above parenthesis with (0.3,0.3,0.3) approx = 1; %Order of approximation desired %Compute numerical derivatives of f num_eval [gx,hx] = gx_hx(nfy,nfx,nfyp,nfxp); T=21 %Compute impulse responses IR = ir(gx,hx,[0 (shock==1)*(C-CSTAR) (shock==2)*1 (shock==3)*1],T); Ir(:,:,shock) = IR; t=(0:size(IR,1)-1)'; c = squeeze(Ir(:,5,:)); h = squeeze(Ir(:,4,:)); w = squeeze(Ir(:,3,:)); iv = squeeze(Ir(:,6,:)); u= squeeze(Ir(:,7,:)); output = squeeze(Ir(:,2,:)); mu = squeeze(Ir(:,1,:)); g = squeeze(Ir(:,10,:)); a = squeeze(Ir(:,11,:)); subplot(3,4,1+(shock-1)*4) plot(t,mu(:,shock),'-') title('Markup') %ylabel('% dev. from ss') subplot(3,4,2+(shock-1)*4) plot(t,output(:,shock)) title('Output') %ylabel('% dev. from ss') subplot(3,4,3+(shock-1)*4) plot(t,w(:,shock)) title('Wage') %ylabel('% dev. from ss') subplot(3,4,4+(shock-1)*4) plot(t,c(:,shock)) title('Consumption') %ylabel('% dev. from ss') end shg