clear all;
taumax = 18;
gridfine = 0.01;
ngrid = 1/gridfine;
N = taumax/gridfine;
wH = 2483; % value from line 5 of table 1
wL = 695; % value from line 5 of table 1
xH = log(-log(0.356)); % 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)*gridfine;
zL = exp(-cumsum(zL));
zL = zL*wL;
zH = exp(xH + d*t)*gridfine;
zH = exp(-cumsum(zH));
zH = zH*wH;
hpred = zL + zH;

wH = 3178; % value from line 2
wL = 0; 
xH = log(-log(0.484));% value from line 2
xL = 0;
d = 0.0;

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,zH,'-','LineWidth',2,'Color',[0 0 1])
set(gca,'FontSize',20)
xlabel('Duration of unemployment (n)')
ylabel('Average number of unemployed (in thousands)')
title('Homogeneous workers')
str1=sprintf('wp^n', 176);
text(2.5,1700,str1, 'fontsize', 20)
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,'graph_homog','epsc');

