%COMPETITIVE_RUN.M %competitive_run(economy) %Compute a second-order accurate level of welfare and welfare cost measure for a particular interest-rate rule relative to the ramsey-optimal rule in the model devaloped in ``Optimal, Simple, and Implementable Monetary and Fiscal Rules,'' by S. Schmitt-Grohe and Martin Uribe (2006). Welfare is measured conditional on the intial state being the ramsey steady state and unconditionally. %ECONOMY is a string indicating the parameterization of the monetary policy. Possible values are: 'taylor', 'taylor_simple', 'optimized_no_smoothing', 'inflation_targeting', 'optimized_x_y' where x takes the values 'smoothing' and 'no_smoothing' and y takes the values 'crule', 'brule' 'frule', or 'drule'. %Prerequisits: RAMSEY_SS.mat (produced by RAMSEY_SS.M) and COMPETITIVE_F.MAT (produced by COMPETITIVE_F.M) and welfare_ramsey.mat (produced by ramsey_run.m) %OUtput: A mat file eval([economy '_run.mat']) %(c) Stephanie Schmitt-Grohe and Martin Uribe, June 2006 function competitive_run(economy) load competitive_f %produced by COMPETITIVE_F.M load ramsey_ss %produced by ramsey_ss.m %Symbols pertaining to the policy rule RSTAR = r_cu; PAISTAR = pai_cu; OUTPUT = output_cu; %Taylor Rule if strcmp(economy,'taylor') ALFA_R_CU = 1; ALFA_R_BA1 = 0; ALFA_PAI = 1.5; ALFA_Y = 0.5; GAMA1 = 0.5; crule = 1; brule = 0; frule = 0; drule = 0; %Simple Taylor Rule elseif strcmp(economy,'taylor_simple') ALFA_R_CU = 1; ALFA_R_BA1 = 0; ALFA_PAI = 1.5; ALFA_Y = 0; GAMA1 = 0.5; crule = 1; brule = 0; frule = 0; drule = 0; %Inflation Targeting elseif strcmp(economy,'inflation_targeting') ALFA_R_CU = 0; ALFA_R_BA1 = 0; ALFA_PAI = 1; ALFA_Y = 0; GAMA1 = 0.5; crule = 1; brule = 0; frule = 0; drule = 0; %Optimized Rules else eval(['load ' economy '.mat']) %produced by competitive_optimized.m end approx = 2; num_eval [gx,hx,exitflag] = gx_hx(nfy,nfx,nfyp,nfxp); disp('done with gx_hx') if exitflag==1 [gxx,hxx] = gxx_hxx_noloop(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') %Recall that the innovation to the state vector is given by sig * ETAMATRIX * eps_{t+1}, where sig 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; [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 eval(['conditional_welfare_' economy ' = vt_cu + gss(1) * sig^2 / 2']) %welfare cost realtive to Ramsey load welfare_ramsey; %produced by ramsey_run.m grss = (conditional_welfare_ramsey - ss_welfare_ramsey) * 2 / sig_ramsey^2; eval(['conditional_welfare_cost_' economy ' = (grss-gss(1))/((1-SIGMA)*ss_welfare_ramsey+1/(1-BETTA))*sig^2/2*100']); %Unconditional welfare [Ey,Ex] = unconditional_mean(gx, hx, gxx, hxx, gss, hss, ETAMATRIX, 1); eval(['unconditional_welfare_' economy ' = Ey(1) + ss_welfare_ramsey']); %Uncionditional welfare cost eval(['unconditional_welfare_cost_' economy ' = (unconditional_welfare_ramsey-Ey(1) - ss_welfare_ramsey)/((1-SIGMA)*ss_welfare_ramsey+1/(1-BETTA))*100']); eval(['save ' economy '_run.mat']) end %if exitflag==1