File size: 14,731 Bytes
b4ae6c9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 | clc;
clear all;
close all;
%% Set values for parameters that never change
global pigrdpts pigrid pigriddiv yb yg beta b gam eta pkh lam alph pi0 kh sigeps A kr
% grid for \pi
pigrdpts=1500;
pigrdwidth=1/pigrdpts;
pilo=0;
pihi=1;
% values of pigrid represent the "midpoint" of a particular gridpoint, and
% values pigriddiv represent the "dividing point" between two successive
% gridpoints.
pigriddiv=(pilo:pigrdwidth:pihi); % dividing points between gridpoint ranges
pigrid=(pilo+pigrdwidth/2:pigrdwidth:pihi-pigrdwidth/2);
yb=.4; % productivity of bad match
yg=1; % productivity of good match
beta=.96^(1/52); % 4 percent annual discount rate (period is a week)
b=.4; % flow value of leisure
gam=0.5; % elasticity of matches wrt unemp
eta=0.5; % workers' barg power
pkh=1/52; % hazard rate for ending of start-up costs
options=optimset('TolFun',1e-12,'Display','none'); % set convergence tolerance for fsolve
% parameters in 'solvemodel' function that we will want to access in this program
global pe pf u e0 e1 w0 w1 tendist probmatch probg H_pi_dist pibar theta oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur
%% % Baseline results with pi0=0.40 (results for pi0=0.38, shown in the
% Appendix, are derived further below)
% Exercises that hold pi0 and kh fixed
pi0=0.4; % prior that y=y_g
kh=0.11; % training/start-up costs
% 1999 calibration
alph=0.146;
lam=0.0085;
startvals=[0.809; 0.232; 0.813]; % starting values for [sigeps; A; kr] (chosen here with knowledge of solution, based on having previously solved)
targets=[0.419; 0.486; 22.7/7]; % targeted values for probg, jfr, and meanvacdur (1999)
[Params1999, fval]=fsolve(@(x) solvemodel(x, targets, 1, 0), startvals, options);
% reveal the calibrated 1999 values of sigeps, A, and kr
Params1999
disp('Calculations for Table 4')
% % Table 4: The model's 1999 moments are calculated and displayed here
% 1999 values of model moments
disp('1999 values of model moments')
stats1999=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u]
% 2017 calibration
alph=0.124;
lam=0.0068;
startvals=[0.555; 0.197; 0.951]; % starting values for sigeps, A, and kr
targets=[0.463; 0.364; 28.1/7]; % targeted values for probg, jfr, and meanvacdur (2017)
disp('Calculations for Table 5')
% Solve for parameters
[Params2017a, fval]=fsolve(@(x) solvemodel(x, targets, 1, 0), startvals, options);
% reveal the calibrated 2017 values of sigeps, A, and kr
disp('Calibrated values of sigeps, A, and kr:')
Params2017a
% show the 2017 model moments
disp('2017 values of model moments:')
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u]
disp('Calculations for Table 6')
% % Table 6 results: The following code shows (changes in) the statistics of
% interest for the decompositions that change parameters one at a time to
% their 2017 values
alph=0.146; % set alph back to its 1999 value
lam=0.0085; % set lam back to its 1999 value
% change kr
solvemodel([Params1999(1); Params1999(2); Params2017a(3)],targets, 1, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in kr:')
stats2017-stats1999
% change A
solvemodel([Params1999(1); Params2017a(2); Params1999(3)],targets, 1, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in A:')
stats2017-stats1999
% change lam
lam=0.0068;
solvemodel(Params1999, targets, 1, 0);
lam=0.0085; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in lam:')
stats2017-stats1999
% change alph
alph=0.124;
lam=0.0085;
solvemodel(Params1999, targets, 1, 0);
alph=0.146; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in alph:')
stats2017-stats1999
% change sigeps
solvemodel([Params2017a(1); Params1999(2); Params1999(3)],targets, 1, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in sigeps:')
stats2017-stats1999
%% Exercises that hold sigeps and kh fixed
% Note that there is no need here to re-do anything for the 1999
% calibration. These exercises are just re-doing the 2017 calibration under
% the assumption that now pi0, rather than sigeps, is allowed to vary.
sigeps=0.8088; % fix this at the 1999 calibrated value
kh=0.11;
% 2017 calibration
alph=0.124;
lam=0.0068;
startvals=[0.452; 0.169; 0.951]; % starting values for pi0, A, and kr
targets=[0.463; 0.364; 28.1/7]; % targeted values for probg, jfr, and meanvacdur (2017)
% Solve for parameters, and show the 2017 model moments
[Params2017b, fval]=fsolve(@(x) solvemodel(x, targets, 2, 0), startvals, options); % note: the third argument here is 2, indicating that the three free parameters are pi0, A, and kr
disp('Calculations for Table 7')
% reveal the calibrated 2017 values of pi0, A, and kr
disp('Calibrated values of pi0, A, and kr:')
Params2017b
disp('2017 values of model moments:')
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u]
% % Table 7 results: The following code shows (changes in) the statistics of
% interest for the decompositions that change parameters one at a time to
% their 2017 values
alph=0.146; % set alph back to its 1999 value
lam=0.0085; % set lam back to its 1999 value
% note: here the first parameter is pi0, so need to set it to its 1999 value
% of 0.4
% change kr
solvemodel([0.4; Params1999(2); Params2017b(3)],targets, 2, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in kr:')
stats2017-stats1999
% change A
solvemodel([0.4; Params2017b(2); Params1999(3)],targets, 2, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in A:')
stats2017-stats1999
% change lam
lam=0.0068;
solvemodel([0.4; Params1999(2); Params1999(3)], targets, 2, 0);
lam=0.0085; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in lam:')
stats2017-stats1999
% change alph
alph=0.124;
lam=0.0085;
solvemodel([0.4; Params1999(2); Params1999(3)], targets, 2, 0);
alph=0.146; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in alph:')
stats2017-stats1999
% change pi0
solvemodel([Params2017b(1); Params1999(2); Params1999(3)],targets, 2, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in pi0:')
stats2017-stats1999
%% Exercises that hold pi0 and kr fixed
pi0=0.4;
kr=.8141; % fix this at the 1999 calibrated value
% 2017 calibration
alph=.124;
lam=.0068;
startvals=[0.650; 0.202; 0.345]; % starting values for sigeps, A, and kh
targets=[.463; .364; 28.1/7];
[Params2017c, fval]=fsolve(@(x) solvemodel(x, targets, 3, 0), startvals, options); % note: the third argument here is 3, indicating that the three free parameters are pi0, A, and kh
disp('Calculations for Table 8')
% reveal the calibrated 2017 values of sigeps, A, and kh
disp('Calibrated values of sigeps, A, and kh:')
Params2017c
disp('2017 values of model moments:')
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u]
% % Table 8 results: The following code shows (changes in) the statistics of
% interest for the decompositions that change parameters one at a time to
% their 2017 values
alph=0.146; % set alph back to its 1999 value
lam=0.0085; % set lam back to its 1999 value
% note: here the third parameter is kh, so need to set it to its 1999 value
% of 0.11 (except for the exercise where it is being changed)
% change kh
solvemodel([Params1999(1); Params1999(2); Params2017c(3)], targets, 3, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in kh:')
stats2017-stats1999
% change A
solvemodel([Params1999(1); Params2017c(2); 0.11],targets, 3, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in A:')
stats2017-stats1999
% change lam
lam=0.0068;
solvemodel([Params1999(1); Params1999(2); 0.11], targets, 3, 0);
lam=0.0085; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in lam:')
stats2017-stats1999
% change alph
alph=0.124;
lam=0.0085;
solvemodel([Params1999(1); Params1999(2); 0.11], targets, 3, 0);
alph=0.146; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in alph:')
stats2017-stats1999
% change sigeps
solvemodel([Params2017c(1); Params1999(2); 0.11],targets, 3, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in sigeps:')
stats2017-stats1999
%% Appendix. Re-do the exercises, but with a baseline value of pi0=0.38 (version of model in which sigeps, A, and kr can change)
disp('Calculations for the table in the Appendix')
pi0=0.38; % prior that y=y_g
kh=0.11; % training/start-up costs
% 1999 calibration
alph=0.146;
lam=0.0085;
startvals=[0.691; 0.249; 0.813]; % starting values for [sigeps; A; kr] (chosen here with knowledge of solution, based on having previously solved)
targets=[0.419; 0.486; 22.7/7]; % targeted values for probg, jfr, and meanvacdur (1999)
[Params1999b, fval]=fsolve(@(x) solvemodel(x, targets, 1, 0), startvals, options);
% reveal the calibrated 1999 values of sigeps, A, and kr
Params1999b
% 1999 values of model moments
disp('1999 values of model moments')
stats1999=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u]
% 2017 calibration
alph=0.124;
lam=0.0068;
startvals=[0.515; 0.210; 0.951]; % starting values for sigeps, A, and kr
targets=[0.463; 0.364; 28.1/7]; % targeted values for probg, jfr, and meanvacdur (2017)
% Solve for parameters, and show the 2017 model moments
[Params2017d, fval]=fsolve(@(x) solvemodel(x, targets, 1, 0), startvals, options);
% reveal the calibrated 2017 values of sigeps, A, and kr
disp('Calibrated values of sigeps, A, and kr:')
Params2017d
disp('2017 values of model moments:')
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u]
% % Panel B: The following code shows (changes in) the statistics of
% interest for the decompositions that change parameters one at a time to
% their 2017 values
alph=0.146; % set alph back to its 1999 value
lam=0.0085; % set lam back to its 1999 value
% change kr
solvemodel([Params1999b(1); Params1999b(2); Params2017d(3)],targets, 1, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in kr:')
stats2017-stats1999
% change A
solvemodel([Params1999b(1); Params2017d(2); Params1999b(3)],targets, 1, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in A:')
stats2017-stats1999
% change lam
lam=0.0068;
solvemodel(Params1999b, targets, 1, 0);
lam=0.0085; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in lam:')
stats2017-stats1999
% change alph
alph=0.124;
lam=0.0085;
solvemodel(Params1999b, targets, 1, 0);
alph=0.146; % restore to 1999 value
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in alph:')
stats2017-stats1999
% change sigeps
solvemodel([Params2017d(1); Params1999b(2); Params1999b(3)],targets, 1, 0);
stats2017=[oneqhazrate twoqhazrate threeplushazrate hiresrate jfr meanvacdur u];
disp('Changes due to change in sigeps:')
stats2017-stats1999
%% Calculate mean wages at different tenure
% Before running the code that calculates average wages, we
% first need to solve a version of the model, so as to determine the
% equilibrium values of the variables needed to calculate those averages
% wages, such as probmatch, pe, pf, etc.
disp('Calculations for section 5.5')
% Calculations in third paragraph of section 5.5
disp('Third paragraph')
pi0=0.4; % reset to value from baseline parameterization.
% % 1999
alph=0.146; lam=0.0085;
solvemodel(Params1999, targets, 1, 0);
calculate_mean_wages
q1wages1999=mean_wages_first_qtr;
y5wages1999=mean_wages_fifth_year;
% % 2017
alph=0.124; lam=0.0068;
solvemodel(Params2017a, targets, 1, 0);
calculate_mean_wages
q1wages2017=mean_wages_first_qtr;
y5wages2017=mean_wages_fifth_year;
disp('Percentage change in first-quarter mean wages')
q1wages2017/q1wages1999-1
disp('Percentage change in first-quarter/fifth-year ratio')
(q1wages2017/y5wages2017)/(q1wages1999/y5wages1999)-1
% Calculations for fourth paragraph of section 5.5
disp('Fourth paragraph')
% % 2017 value for sigeps, 1999 for all others
alph=0.146; lam=0.0085;
solvemodel([Params2017a(1); Params1999(2); Params1999(3)], targets, 1, 0);
calculate_mean_wages
q1wages2017=mean_wages_first_qtr;
y5wages2017=mean_wages_fifth_year;
disp('Percentage change in first-quarter mean wages')
q1wages2017/q1wages1999-1
disp('Percentage change in first-quarter/fifth-year ratio')
(q1wages2017/y5wages2017)/(q1wages1999/y5wages1999)-1
% Calculations for fifth paragraph of section 5.5
solvemodel(Params2017c, targets, 3, 0);
calculate_mean_wages
disp('first-quarter wages in 1999')
q1wages1999
disp('first-quarter wages in 2017')
q1wages2017=mean_wages_first_qtr
disp('Percentage change in first-quarter mean wages')
round(q1wages2017,3)/round(q1wages1999,3)-1
disp('fifth-year wages in 1999')
round(y5wages1999,3)
disp('fifth-year wages in 2017')
y5wages2017=mean_wages_fifth_year;
round(y5wages2017,3)
disp('Percentage change in fifth-year mean wages')
round(y5wages2017,3)/round(y5wages1999,3)-1
|