REPRO-Bench / 16 /replication_package /programs /calculate_mean_wages.m
anonymous-submission-acl2025's picture
add 16
b4ae6c9
% This is not a function m-file, but rather just a block of code that we
% need to run repeatedly to calculate mean wages
% Calculate ergodic distribution.
% 5 "states": unemployed, paying k_h and unknown type, not paying k_h and
% unknown type, paying k_h and known type, not paying k_h and
% known type
tmatrix=[1-pf*probmatch, lam+(1-lam)*alph*(1-probg), lam+(1-lam)*alph*(1-probg), lam, lam;...
pf*probmatch, (1-lam)*(1-pkh)*(1-alph), 0, 0, 0;...
0, (1-lam)*(1-alph)*pkh, (1-lam)*(1-alph), 0, 0;...
0, (1-lam)*(1-pkh)*alph*probg, 0, (1-lam)*(1-pkh), 0;...
0, (1-lam)*pkh*alph*probg, (1-lam)*alph*probg, (1-lam)*pkh, (1-lam)];
% steady state distribution
mtr=eye(5)-tmatrix;
mtr(5,1:5)=1;
invmtr=inv(mtr);
erg=invmtr(:,5);
u=erg(1); % unemployment
e0pi=erg(2); % matches paying k_h, unknown type
e1pi=erg(3); % matches not paying k_h, unknown type
e01=erg(4); % matches paying k_h, known type
e11=erg(5); % matches not paying k_h, known type
% % Mean wages
meanwages=(e01*w0(end)+e11*w1(end)+((e0pi*w0+e1pi*w1).*H_pi_dist)*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)))/(1-u);
% calculate the distribution across the 5 states, as a function of tenure
nperiods=260; % # of periods to calculate profile
tendist=[0;1;0;0;0];
trans1=tmatrix;
trans1(:,1)=0; % don't allow any exits from unemployment after first period, so this just tracks the initial mass of entrants
for i=2:nperiods
tendist(:,i)=trans1*tendist(:,i-1) ;
end
% calculate average wages as a function of tenure:
ave_wg_ten_profile= [w0.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w1.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w0(end) w1(end)]*tendist(2:5,:)./sum(tendist(2:5,:));
mean_wages_first_qtr=sum([w0.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w1.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w0(end) w1(end)]*tendist(2:5,1:13))./sum(sum(tendist(2:5,1:13)));
mean_wages_first_year=sum([w0.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w1.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w0(end) w1(end)]*tendist(2:5,1:52))./sum(sum(tendist(2:5,1:52)));
mean_wages_third_year=sum([w0.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w1.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w0(end) w1(end)]*tendist(2:5,105:156))./sum(sum(tendist(2:5,105:156)));
mean_wages_fifth_year=sum([w0.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w1.*H_pi_dist*(pigrid>pibar)'/sum(H_pi_dist(pigrid>pibar)) w0(end) w1(end)]*tendist(2:5,209:260))./sum(sum(tendist(2:5,209:260)));