%
% Plot Wage Markups for Smets-Wouters with CES production
%

load usmodel_ces_results
cindw        = .6372;
cprobw       = .8127;
constepinf   = .7612;
constebeta   = .1425;
csigma       = 1.3858;
ctrend       = .4337;
cpie         = 1+constepinf/100;
cgamma       = 1+ctrend/100 ;
cbeta        = 1/(1+constebeta/100);
cbetabar     = cbeta*cgamma^(-csigma);
chabb        = .7065;
csigl        = 1.3475;
a            = (1-cprobw)*(1-cbetabar*cgamma*cprobw)/ ...
               ((1+cbetabar*cgamma)*cprobw);
sw           = oo_.SmoothedVariables.sw;
lab          = oo_.SmoothedVariables.lab;
c            = oo_.SmoothedVariables.c;
clag         = [NaN;c(1:length(c)-1)];
w            = oo_.SmoothedVariables.w;
markupshk    = sw/a;
mrslessw     = csigl*lab +(1/(1-chabb/cgamma))*c-((chabb/cgamma)/ ...
               (1-chabb/cgamma))*clag -w;
t            = ptime(1965.1,length(oo_.SmoothedVariables.c),4);
lambda       = 1.5*(markupshk-mean(markupshk))+50;


figure(1)
plot(t,mrslessw,t,markupshk)
title('Wage Markup and Wage Markup Shock (Logged Deviations x 100)', ...
      'Fontsize',16)
legend('Wage Markup: log(mrs)-log(real wage)','Shock added to wage markup', ...
       'Location','Southwest')
set(gca,'Fontsize',16)

figure(2)
plot(t,lambda*100)
title(['Percent Markup \lambda in L_i/L=[W/W_i]^(^1^+^\lambda^)^/', ...
       '^\lambda (Mean=50%)'],'Fontsize',16)
set(gca,'Fontsize',16)

%
% NOTE: The real wage equation in SW is
%
%
%  w =  (1/(1+cbetabar*cgamma))*w(-1)
%               +(cbetabar*cgamma/(1+cbetabar*cgamma))*w(1)
%               +(cindw/(1+cbetabar*cgamma))*pinf(-1)
%               -(1+cbetabar*cgamma*cindw)/(1+cbetabar*cgamma)*pinf
%               +(cbetabar*cgamma)/(1+cbetabar*cgamma)*pinf(1)
%               +(1-cprobw)*(1-cbetabar*cgamma*cprobw)/
%                   ((1+cbetabar*cgamma)*cprobw)*(1/((clandaw-1)*curvw+1))*
%                     (csigl*lab + (1/(1-chabb/cgamma))*c 
%                          - ((chabb/cgamma)/(1-chabb/cgamma))*c(-1)-w)
%              + 1*sw 
