clear all;
taumax = 18;
gridfine = 0.01; % originally 0.01
ngrid = 1/gridfine;
N = taumax/gridfine;
wH = 2482; % value from line 5 of table 1
wL = 696;% value from line 5 of table 1
xH = log(-log(0.355));% value from line 5 of table 1
xL = log(-log(0.844));% value from line 5 of table 1
d = -0.005;% value from line 5 of table 1
tstart = 1/gridfine;
t = tstart:N;
t = t*gridfine;
zL = exp(xL + d*(t-1))*gridfine;
zL = exp(-cumsum(zL));
zL = zL*wL;
zH = exp(xH + d*(t-1))*gridfine;
zH = exp(-cumsum(zH));
zH = zH*wH;
hpred = zL + zH;

wH = 2478;% value from line 3 of table 1
wL = 701;% value from line 3 of table 1
xH = log(-log(0.354));% value from line 3 of table 1
xL = log(-log(0.846));% value from line 3 of table 1
d = 0.0;% value from line 3 of table 1

zL = exp(xL + d*t)*gridfine;
zL = exp(-cumsum(zL));
zL = zL*wL;
zH = exp(xH + d*t)*gridfine;
zH = exp(-cumsum(zH));
zH = zH*wH;

g1=figure 
hold on;
plot(t,zL,'-','LineWidth',5,'Color',[1 0 0])
plot(t,zL+zH,':','LineWidth',3,'Color',[0 0 1])
set(gca,'FontSize',20)
xlabel('Duration of unemployment (n)')
ylabel('Average number of unemployed (in thousands)')
title('Heterogeneous workers')
str1=sprintf('w_Lp_L^n', 176);
text(0.5,300,str1, 'fontsize', 20)
str2=sprintf('w_Lp_L^n + w_Hp_H^n', 176);
text(1.8,2000,str2, 'fontsize', 20)
%hold on;
plot(1,hpred(1),'k.','MarkerSize',30)
plot(3,hpred((3-1)*ngrid),'k.','MarkerSize',30)
plot(5,hpred((5-1)*ngrid),'k.','MarkerSize',30)
plot(9.5,hpred((9.5-1)*ngrid),'k.','MarkerSize',30)
plot(15,hpred((15-1)*ngrid),'k.','MarkerSize',30)
hold off;
saveas(g1,'jh_graph2','epsc');
