%RAMSEY_RUN.M %Compute a second-order approximation of the Ramsey equilibrium conditions of the model developed in ``Optimal, Simple, and Implementable Monetary and Fiscal Rules,'' by S. Schmitt-Grohe and Martin Uribe (2006) %(c) Stephanie Schmitt-Grohe and Martin Uribe, May 2006 %Prerequisits: run RAMSEY_SS.mat (produced by RAMSEY_SS.M) and RAMSEY_F.MAT (produced by RAMSEY_F.M) %Output: RAMSEY_RUN.MAT clear all load ramsey_f %produced by RAMSEY_F.M load ramsey_ss %This is saved automatically, when running ramsey_ss.m approx = 2; num_eval [gx,hx] = gx_hx(nfy,nfx,nfyp,nfxp); disp('done with gx_hx') %Recall that the innovation to the state vector is given by sigma * ETAMATRIX * eps_{t+1}, where sigma is a scalar, ETAMATRIX is a nx*ne matrix and eps_t is a vector of exogenous innovations of size neX1 distributed (0,I); ne=2; ETAMATRIX = zeros(size(fx,2),ne); %The gov't purchases and techno shocks take the last 2 elements of the state vector x (see ramsey_f.M). Thus, ETAMATRIX(end-1,1)=STD_EPSG; ETAMATRIX(end,2)=STD_EPSZ; if approx==2 [gxx,hxx] = gxx_hxx(nfx,nfxp,nfy,nfyp,nfypyp,nfypy,nfypxp,nfypx,nfyyp,nfyy,nfyxp,nfyx,nfxpyp,nfxpy,nfxpxp,nfxpx,nfxyp,nfxy,nfxxp,nfxx,hx,gx); disp('done with gxx_hxx') [gss,hss] = gss_hss(nfx,nfxp,nfy,nfyp,nfypyp,nfypy,nfypxp,nfypx,nfyyp,nfyy,nfyxp,nfyx,nfxpyp,nfxpy,nfxpxp,nfxpx,nfxyp,nfxy,nfxxp,nfxx,hx,gx,gxx,ETAMATRIX); disp('done with gss_hss') sig =1; conditional_welfare = vt_cu + gss(1) * sig^2 / 2 [Ey,Ex] = unconditional_mean(gx, hx, gxx, hxx, gss, hss, ETAMATRIX, 1); unconditional_welfare = Ey(1) + vt_cu; end %if approx==2 save ramsey_run.mat %material for computing welfare costs (used in competitive_run.m) conditional_welfare_ramsey=conditional_welfare; unconditional_welfare_ramsey=unconditional_welfare; ss_welfare_ramsey = vt_cu; sig_ramsey = sig; save welfare_ramsey.mat BETTA SIGMA sig_ramsey conditional_welfare_ramsey unconditional_welfare_ramsey ss_welfare_ramsey