| 1 |
// Based on Luca Marchiori/Olivier Pierrard(2012) LOLA 2.0: Luxembourg |
| 2 |
// OverLapping generation model for policy Analysis |
| 3 |
|
| 4 |
/* Snippet common to several test files. |
| 5 |
|
| 6 |
Macro-variables that can be defined to tune the computations: |
| 7 |
- block |
| 8 |
- mfs |
| 9 |
*/ |
| 10 |
|
| 11 |
load lola_data.mat |
| 12 |
|
| 13 |
% ==================================================== |
| 14 |
% declarations var -- varexo -- para |
| 15 |
% ==================================================== |
| 16 |
|
| 17 |
@#define nbr_work_generations=9 |
| 18 |
@#define nbr_early_generations=2 |
| 19 |
@#define nbr_generations=16 |
| 20 |
|
| 21 |
parameters |
| 22 |
length_period age_early; |
| 23 |
|
| 24 |
length_period=5; |
| 25 |
age_early=55; |
| 26 |
|
| 27 |
@#define wt=[1] |
| 28 |
|
| 29 |
@#define wg=0:nbr_work_generations-1 |
| 30 |
@#define ag=0:nbr_generations-1 |
| 31 |
@#define fwg=0:nbr_work_generations-nbr_early_generations-1 |
| 32 |
@#define nbwg=1:nbr_work_generations-1 |
| 33 |
@#define nbg=1:nbr_generations-1 |
| 34 |
@#define rg=nbr_work_generations:nbr_generations-1 |
| 35 |
@#define erg=nbr_work_generations-nbr_early_generations:nbr_work_generations-1 |
| 36 |
@#define endg=[nbr_generations-1] |
| 37 |
@#define endw=[nbr_work_generations-1] |
| 38 |
|
| 39 |
@#for i in wg |
| 40 |
var |
| 41 |
n@{i} u@{i} Omega@{i} w@{i} dWHN@{i} dWFN@{i} |
| 42 |
n@{i}_f u@{i}_f Omega@{i}_f w@{i}_f dWFN@{i}_f |
| 43 |
i@{i} lambda@{i} i@{i}_f lambda@{i}_f eta@{i}; |
| 44 |
parameters |
| 45 |
Du@{i} Dn@{i} h@{i} h@{i}_f chi@{i} eta@{i}b; |
| 46 |
varexo |
| 47 |
eps_eta@{i}; |
| 48 |
@#endfor |
| 49 |
|
| 50 |
@#for i in ag |
| 51 |
var |
| 52 |
c@{i} s@{i} P@{i} P@{i}_f; |
| 53 |
varexo |
| 54 |
beta@{i} beta@{i}_f PD@{i}; |
| 55 |
@#endfor |
| 56 |
|
| 57 |
@#for i in erg |
| 58 |
var |
| 59 |
WE@{i} De_@{i}; |
| 60 |
parameters |
| 61 |
De_@{i}b; |
| 62 |
varexo |
| 63 |
eps_De_@{i}; |
| 64 |
@#endfor |
| 65 |
|
| 66 |
var |
| 67 |
wb wb_f |
| 68 |
Omega Omega_f Omega_hf |
| 69 |
V M qq p |
| 70 |
N N_f |
| 71 |
Q RR H K Y gdp nx FH pi |
| 72 |
ct st wshare rr |
| 73 |
gamma mc phii D DH DF X bs bsY P00_f |
| 74 |
|
| 75 |
rhou rhoe rhol tauw tauc tauf tauk g |
| 76 |
TFP gh rrb |
| 77 |
theta tau1 om1 om2 om2s Ds phijs |
| 78 |
|
| 79 |
DepRatio DepRatio_n DepRatio_d ZARA Ptot Ptot_f sleep du de dl inA inB in |
| 80 |
NBR NBRY NBR2 tauw2 tauf2 tauc2 |
| 81 |
PensCorr_L PensCorr_F; |
| 82 |
|
| 83 |
parameters |
| 84 |
rho phi delta alpha beta ann |
| 85 |
fc nu aa |
| 86 |
|
| 87 |
rhoub rhoeb rholb tauwb taucb taufb taukb gb |
| 88 |
TFPb ghb rrbb |
| 89 |
thetab tau1b om1b om2b om2sb Dsb phijsb |
| 90 |
|
| 91 |
NBRYb bsY_iss; |
| 92 |
|
| 93 |
varexo |
| 94 |
P00 P00_foP00 |
| 95 |
|
| 96 |
eps_rhol eps_tauw eps_tauf eps_tauc eps_tauk |
| 97 |
eps_rhoe eps_rhou eps_TFP eps_gh eps_theta eps_g |
| 98 |
eps_Ds eps_phijs eps_PensCorr_L eps_PensCorr_F; |
| 99 |
|
| 100 |
|
| 101 |
% ============================================================ |
| 102 |
% initialization |
| 103 |
% ============================================================ |
| 104 |
|
| 105 |
@#for i in wg |
| 106 |
set_param_value('Du@{i}',Du@{i}); |
| 107 |
set_param_value('Dn@{i}',Dn@{i}); |
| 108 |
set_param_value('h@{i}',h@{i}); |
| 109 |
set_param_value('h@{i}_f',h@{i}_f); |
| 110 |
set_param_value('chi@{i}',chi@{i}); |
| 111 |
set_param_value('eta@{i}b',eta@{i}b); |
| 112 |
@#endfor |
| 113 |
|
| 114 |
@#for i in erg |
| 115 |
set_param_value('De_@{i}b',De_@{i}b); |
| 116 |
@#endfor |
| 117 |
|
| 118 |
set_param_value('rho',rho); |
| 119 |
set_param_value('phi',phi); |
| 120 |
set_param_value('delta',delta); |
| 121 |
set_param_value('alpha',alpha); |
| 122 |
set_param_value('beta',beta); |
| 123 |
set_param_value('ann',ann); |
| 124 |
set_param_value('fc',fc); |
| 125 |
set_param_value('nu',nu); |
| 126 |
set_param_value('aa',aa); |
| 127 |
|
| 128 |
set_param_value('rhoub',rhoub); |
| 129 |
set_param_value('rhoeb',rhoeb); |
| 130 |
set_param_value('rholb',rholb); |
| 131 |
set_param_value('tauwb',tauwb); |
| 132 |
set_param_value('taucb',taucb); |
| 133 |
set_param_value('taufb',taufb); |
| 134 |
set_param_value('taukb',taukb); |
| 135 |
set_param_value('gb',gb); |
| 136 |
|
| 137 |
set_param_value('TFPb',TFPb); |
| 138 |
set_param_value('ghb',ghb); |
| 139 |
set_param_value('rrbb',rrbb); |
| 140 |
|
| 141 |
set_param_value('thetab',thetab); |
| 142 |
set_param_value('tau1b',tau1b); |
| 143 |
set_param_value('om1b',om1b); |
| 144 |
set_param_value('om2b',om2b); |
| 145 |
set_param_value('om2sb',om2sb); |
| 146 |
set_param_value('Dsb',Dsb); |
| 147 |
set_param_value('phijsb',phijsb); |
| 148 |
|
| 149 |
set_param_value('bsY_iss',bsY_iss); |
| 150 |
|
| 151 |
NBRYb=NBR_iss/(phii_iss*gdp_iss); |
| 152 |
|
| 153 |
|
| 154 |
|
| 155 |
@#if block |
| 156 |
model(block, mfs=@{mfs}, static_mfs=@{mfs}); |
| 157 |
@#else |
| 158 |
model; |
| 159 |
@#endif |
| 160 |
|
| 161 |
% Labor Market Variables in the home country |
| 162 |
% ------------------------------------------ |
| 163 |
|
| 164 |
@#for i in fwg |
| 165 |
0=lambda@{i}; |
| 166 |
@#endfor |
| 167 |
|
| 168 |
@#for i in wg |
| 169 |
1=n@{i}+u@{i}+i@{i}; |
| 170 |
@#endfor |
| 171 |
|
| 172 |
i0=lambda0; |
| 173 |
@#for i in nbwg |
| 174 |
i@{i}=lambda@{i-1}(-1)+lambda@{i}*(1-lambda@{i-1}(-1)); |
| 175 |
@#endfor |
| 176 |
|
| 177 |
P0=beta0*P00+PD0; |
| 178 |
@#for i in nbg |
| 179 |
P@{i}=beta@{i}*P@{i-1}(-1)+PD@{i}; |
| 180 |
@#endfor |
| 181 |
|
| 182 |
Omega0=P0; |
| 183 |
@#for i in nbwg |
| 184 |
Omega@{i}=(1-lambda@{i})*( 1-lambda@{i-1}(-1)-(1-chi@{i})*n@{i-1}(-1))*P@{i}; |
| 185 |
@#endfor |
| 186 |
|
| 187 |
n0=p; |
| 188 |
@#for i in nbwg |
| 189 |
n@{i}=(1-lambda@{i})*((1-p)*(1-chi@{i})*n@{i-1}(-1)+p*(1-lambda@{i-1}(-1))); |
| 190 |
@#endfor |
| 191 |
|
| 192 |
N= |
| 193 |
@#for i in wg |
| 194 |
+n@{i}*P@{i} |
| 195 |
@#endfor |
| 196 |
; |
| 197 |
|
| 198 |
% Labor Market Variables in the foreign country |
| 199 |
% --------------------------------------------- |
| 200 |
|
| 201 |
@#for i in wg |
| 202 |
1=n@{i}_f+u@{i}_f+i@{i}_f; |
| 203 |
@#endfor |
| 204 |
|
| 205 |
i0_f=lambda0_f; |
| 206 |
@#for i in nbwg |
| 207 |
i@{i}_f=lambda@{i-1}_f(-1)+lambda@{i}_f*(1-lambda@{i-1}_f(-1)); |
| 208 |
@#endfor |
| 209 |
|
| 210 |
% ----------- reproduction cross-border -------------------- |
| 211 |
|
| 212 |
P00_f=P00_foP00*P00; |
| 213 |
|
| 214 |
P0_f=beta0_f*P00_f; |
| 215 |
@#for i in nbg |
| 216 |
P@{i}_f=beta@{i}_f*P@{i-1}_f(-1); |
| 217 |
@#endfor |
| 218 |
|
| 219 |
Omega0_f=P0_f; |
| 220 |
@#for i in nbwg |
| 221 |
Omega@{i}_f=(1-lambda@{i}_f)*(1-lambda@{i-1}_f(-1)-(1-chi@{i})*n@{i-1}_f(-1))*P@{i}_f; |
| 222 |
@#endfor |
| 223 |
|
| 224 |
n0_f=p; |
| 225 |
@#for i in nbwg |
| 226 |
n@{i}_f=(1-lambda@{i}_f)*((1-p)*(1-chi@{i})*n@{i-1}_f(-1)+p*(1-lambda@{i-1}_f(-1))); |
| 227 |
@#endfor |
| 228 |
|
| 229 |
N_f= |
| 230 |
@#for i in wg |
| 231 |
+n@{i}_f*P@{i}_f |
| 232 |
@#endfor |
| 233 |
; |
| 234 |
|
| 235 |
% Matching |
| 236 |
% ---------- |
| 237 |
|
| 238 |
Omega= |
| 239 |
@#for i in wg |
| 240 |
+Omega@{i} |
| 241 |
@#endfor |
| 242 |
; |
| 243 |
|
| 244 |
Omega_f= |
| 245 |
@#for i in wg |
| 246 |
+Omega@{i}_f |
| 247 |
@#endfor |
| 248 |
; |
| 249 |
|
| 250 |
Omega_hf=Omega+Omega_f; |
| 251 |
|
| 252 |
M=V*Omega_hf/(V^nu+Omega_hf^nu)^(1/nu); |
| 253 |
|
| 254 |
qq=M/V; |
| 255 |
p=M/Omega_hf; |
| 256 |
|
| 257 |
% Flow Budget Constraints (no bequests) |
| 258 |
% -------------------------------------- |
| 259 |
|
| 260 |
rhou*w0*u0+ (1-tauw)*w0*n0 = (1+tauc)*c0+s0; |
| 261 |
@#for i in nbwg |
| 262 |
(1+rr*(1-tauk))/(beta@{i})^ann*s@{i-1}(-1)/(1+gh)+rhou*w@{i}*u@{i}+rhoe*w@{i}*i@{i}+(1-tauw)*w@{i}*n@{i}=(1+tauc)*c@{i}+s@{i}; |
| 263 |
@#endfor |
| 264 |
@#for i in rg |
| 265 |
(1+rr*(1-tauk))/(beta@{i})^ann*s@{i-1}(-1)/(1+gh)+rhol*wb=(1+tauc)*c@{i}+s@{i}; |
| 266 |
@#endfor |
| 267 |
@#for i in endg |
| 268 |
s@{i}=0; |
| 269 |
@#endfor |
| 270 |
|
| 271 |
wb= |
| 272 |
@#for i in wg |
| 273 |
+w@{i}/@{nbr_work_generations} |
| 274 |
@#endfor |
| 275 |
; |
| 276 |
|
| 277 |
% Euler Conditions |
| 278 |
% ------------------ |
| 279 |
|
| 280 |
@#for i in nbg |
| 281 |
1/(1+tauc)/c@{i-1}=beta*(1+rr(+1)*(1-tauk(+1)))/(1+tauc(+1))/c@{i}(+1)*(beta@{i})^(1-ann)/(1+gh); |
| 282 |
@#endfor |
| 283 |
|
| 284 |
|
| 285 |
% Optimal Participation Rates (Early Retirement) |
| 286 |
% ---------------------------------------------- |
| 287 |
|
| 288 |
@#for i in erg |
| 289 |
WE@{i} = 0; |
| 290 |
@#endfor |
| 291 |
|
| 292 |
@#for i in erg |
| 293 |
@#if i in endw |
| 294 |
WE@{i} = ((De_@{i}b*i@{i}^(phi-1))+Du@{i}+(rhoe-rhou)*w@{i}/(1+tauc)/c@{i})*(1-i@{i})-((1-tauw-rhou)*w@{i}/(1+tauc)/c@{i}-(Dn@{i}-Du@{i}))*n@{i}; |
| 295 |
@#else |
| 296 |
WE@{i} = ((De_@{i}b*i@{i}^(phi-1))+Du@{i}+(rhoe-rhou)*w@{i}/(1+tauc)/c@{i})*(1-i@{i})-((1-tauw-rhou)*w@{i}/(1+tauc)/c@{i}-(Dn@{i}-Du@{i}))*n@{i}+ beta*beta@{i+1}*WE@{i+1}; |
| 297 |
@#endif |
| 298 |
@#endfor |
| 299 |
|
| 300 |
% Household Surplus |
| 301 |
% ------------------- |
| 302 |
|
| 303 |
@#for i in wg |
| 304 |
@#if i in endw |
| 305 |
dWHN@{i} = w@{i}*(1-tauw-rhou)/(1+tauc)-(Dn@{i}-Du@{i})*c@{i}; |
| 306 |
@#else |
| 307 |
dWHN@{i} = w@{i}*(1-tauw-rhou)/(1+tauc)-(Dn@{i}-Du@{i})*c@{i} + beta*beta@{i+1}*c@{i}/c@{i+1}(+1)*dWHN@{i+1}(+1)*(1-p(+1))*(1-chi@{i+1})*(1-lambda@{i+1}(+1)); |
| 308 |
@#endif |
| 309 |
@#endfor |
| 310 |
|
| 311 |
% Foreign household |
| 312 |
% ------------------------ |
| 313 |
% participation and wages |
| 314 |
% ........................ |
| 315 |
|
| 316 |
@#for i in wg |
| 317 |
lambda@{i}=lambda@{i}_f; |
| 318 |
w@{i}_f=w@{i}; |
| 319 |
@#endfor |
| 320 |
|
| 321 |
wb_f= |
| 322 |
@#for i in wg |
| 323 |
+w@{i}_f/@{nbr_work_generations} |
| 324 |
@#endfor |
| 325 |
; |
| 326 |
|
| 327 |
% Firm's Behavior |
| 328 |
% ------------------- |
| 329 |
|
| 330 |
H= |
| 331 |
@#for i in wg |
| 332 |
+h@{i}*n@{i}*P@{i}+h@{i}_f*n@{i}_f*P@{i}_f |
| 333 |
@#endfor |
| 334 |
; |
| 335 |
|
| 336 |
wshare=(1+tauf)*( |
| 337 |
@#for i in wg |
| 338 |
+w@{i}*n@{i}*P@{i}+w@{i}_f*n@{i}_f*P@{i}_f |
| 339 |
@#endfor |
| 340 |
)/(phii*gdp); |
| 341 |
|
| 342 |
Y=TFP*H^(1-alpha)*(K)^alpha; |
| 343 |
gdp= TFP*H^(1-alpha)*(K)^alpha-aa*V/phii-fc/phii; |
| 344 |
pi = phii*gdp - wshare*phii*gdp - (rr+delta)*K(-1)/(1+gh); |
| 345 |
(rr(+1)+delta)/(1+rr(+1)*(1-tauk(+1))) = mc*TFP*alpha*(H/(K))^(1-alpha); |
| 346 |
FH=TFP*(1-alpha)*((K)/H)^alpha; |
| 347 |
|
| 348 |
RR=1+rr*(1-tauk); |
| 349 |
rr=rrb+tau1*(exp(bsY_iss-bsY)-1); |
| 350 |
|
| 351 |
% Firm's Surplus |
| 352 |
% --------------------- |
| 353 |
|
| 354 |
@#for i in wg |
| 355 |
@#if i in endw |
| 356 |
dWFN@{i} = h@{i}*mc*FH-(1+tauf)*w@{i}; |
| 357 |
dWFN@{i}_f = h@{i}_f*mc*FH-(1+tauf)*w@{i}_f; |
| 358 |
@#else |
| 359 |
dWFN@{i} = h@{i}*mc*FH-(1+tauf)*w@{i} + beta@{i+1}/RR(+1)*dWFN@{i+1}(+1)*(1-chi@{i+1})*(1-lambda@{i+1}(+1))*(1+gh); |
| 360 |
dWFN@{i}_f = h@{i}_f*mc*FH-(1+tauf)*w@{i}_f + beta@{i+1}_f/RR(+1)*dWFN@{i+1}_f(+1)*(1-chi@{i+1})*(1-lambda@{i+1}_f(+1))*(1+gh); |
| 361 |
@#endif |
| 362 |
@#endfor |
| 363 |
|
| 364 |
% Free Entry Condition |
| 365 |
% --------------------- |
| 366 |
|
| 367 |
aa=qq/Omega_hf*( |
| 368 |
@#for i in wg |
| 369 |
+Omega@{i}*dWFN@{i}+Omega@{i}_f*dWFN@{i}_f |
| 370 |
@#endfor |
| 371 |
); |
| 372 |
|
| 373 |
% Wage Determination (Rent Sharing) |
| 374 |
% ----------------------------------- |
| 375 |
|
| 376 |
@#for i in wg |
| 377 |
(1-eta@{i})*dWHN@{i} = eta@{i}*((1-tauw)/(1+tauf)/(1+tauc))*dWFN@{i}; |
| 378 |
@#endfor |
| 379 |
|
| 380 |
% Equilibrium Conditions |
| 381 |
% ---------------------- |
| 382 |
|
| 383 |
ct= |
| 384 |
@#for i in ag |
| 385 |
+c@{i}*P@{i} |
| 386 |
@#endfor |
| 387 |
; |
| 388 |
|
| 389 |
st= |
| 390 |
@#for i in ag |
| 391 |
+s@{i}*P@{i} |
| 392 |
@#endfor |
| 393 |
; |
| 394 |
|
| 395 |
% Non-Arbitrage condition (physical capital-shares) |
| 396 |
% ......................... |
| 397 |
|
| 398 |
Q(+1)+pi(+1)=(1+rr(+1))*Q/(1+gh); |
| 399 |
|
| 400 |
% New Open Economy Macroeconomics (NOEM) |
| 401 |
% --------------------------------------- |
| 402 |
|
| 403 |
phii=mc/theta; |
| 404 |
D= ct + K-(1-delta)*K(-1)/(1+gh) + g*gdp*phii + fc+aa*V; |
| 405 |
DH=(1/om1*phii)^(1/(rho-1))*D; |
| 406 |
X=(1/om2s*phii/gamma)^(1/(rho-1))*Ds; |
| 407 |
DF=(1/om2*gamma*phijs)^(1/(rho-1))*D; |
| 408 |
nx=phii*X-phijs*gamma*DF; |
| 409 |
bsY=bs/(phii*gdp); |
| 410 |
Y=DH+X; |
| 411 |
phii*gdp=ct + K-(1-delta)*K(-1)/(1+gh) + g*gdp*phii+nx; |
| 412 |
|
| 413 |
st=K+Q +bs ; |
| 414 |
|
| 415 |
% Policies |
| 416 |
% ---------- |
| 417 |
|
| 418 |
rhou=rhoub*eps_rhou; |
| 419 |
rhoe=rhoeb*eps_rhoe; |
| 420 |
rhol=rholb*eps_rhol; |
| 421 |
g=gb*eps_g; |
| 422 |
|
| 423 |
@#for i in erg |
| 424 |
De_@{i}=De_@{i}b*eps_De_@{i}; |
| 425 |
@#endfor |
| 426 |
|
| 427 |
TFP=TFPb*eps_TFP; |
| 428 |
gh=ghb*eps_gh; |
| 429 |
|
| 430 |
@#for i in wg |
| 431 |
eta@{i}=eta@{i}b*eps_eta@{i}; |
| 432 |
@#endfor |
| 433 |
|
| 434 |
rrb=rrbb; |
| 435 |
|
| 436 |
theta=thetab*eps_theta; |
| 437 |
tau1=tau1b; |
| 438 |
om1=om1b; |
| 439 |
om2=om2b; |
| 440 |
om2s=om2sb; |
| 441 |
Ds=Dsb*eps_Ds; |
| 442 |
phijs=phijsb*eps_phijs; |
| 443 |
|
| 444 |
|
| 445 |
% ----------- RefDR scenario |
| 446 |
|
| 447 |
DepRatio_n= |
| 448 |
@#for i in rg |
| 449 |
+P@{i} |
| 450 |
@#endfor |
| 451 |
; |
| 452 |
DepRatio_d= |
| 453 |
@#for i in wg |
| 454 |
+P@{i} |
| 455 |
@#endfor |
| 456 |
; |
| 457 |
|
| 458 |
DepRatio=DepRatio_n/DepRatio_d; |
| 459 |
|
| 460 |
ZARA=age_early+length_period*( |
| 461 |
@#for i in erg |
| 462 |
+1-i@{i} |
| 463 |
@#endfor |
| 464 |
); |
| 465 |
|
| 466 |
% ----------- WGEM |
| 467 |
|
| 468 |
Ptot= |
| 469 |
@#for i in ag |
| 470 |
+P@{i} |
| 471 |
@#endfor |
| 472 |
; |
| 473 |
Ptot_f= |
| 474 |
@#for i in ag |
| 475 |
+P@{i}_f |
| 476 |
@#endfor |
| 477 |
; |
| 478 |
|
| 479 |
sleep=(1+rr)*( |
| 480 |
@#for i in nbg |
| 481 |
+1/beta@{i}*(1-1/beta@{i}^(ann-1))*s@{i-1}(-1)*P@{i} |
| 482 |
@#endfor |
| 483 |
)/(1+gh); |
| 484 |
|
| 485 |
du=rhou*( |
| 486 |
@#for i in wg |
| 487 |
+w@{i}*u@{i}*P@{i} |
| 488 |
@#endfor |
| 489 |
); |
| 490 |
|
| 491 |
de=rhoe*( |
| 492 |
@#for i in erg |
| 493 |
+w@{i}*i@{i}*P@{i}+w@{i}_f*i@{i}_f*P@{i}_f |
| 494 |
@#endfor |
| 495 |
); |
| 496 |
|
| 497 |
dl= |
| 498 |
@#for i in rg |
| 499 |
+rhol*wb*PensCorr_L*P@{i}+rhol*wb_f*(N_f/(N+N_f))*PensCorr_F*P@{i}_f |
| 500 |
@#endfor |
| 501 |
; |
| 502 |
|
| 503 |
PensCorr_L=eps_PensCorr_L; |
| 504 |
PensCorr_F=eps_PensCorr_F; |
| 505 |
|
| 506 |
inA=(tauw+tauf)*( |
| 507 |
@#for i in wg |
| 508 |
+n@{i}*w@{i}*P@{i}+n@{i}_f*w@{i}_f*P@{i}_f |
| 509 |
@#endfor |
| 510 |
); |
| 511 |
|
| 512 |
inB=tauk*rr*( |
| 513 |
@#for i in nbg |
| 514 |
+1/beta@{i}^ann*s@{i-1}(-1)*P@{i} |
| 515 |
@#endfor |
| 516 |
)/(1+gh); |
| 517 |
|
| 518 |
in=tauc*ct+inA+inB+sleep; |
| 519 |
NBR=g*phii*gdp+(du+de+dl)-(in); |
| 520 |
NBRY=NBR/(phii*gdp); |
| 521 |
|
| 522 |
% ----------- WGEM Adjustment variable --------------- |
| 523 |
|
| 524 |
tauf2=tauf; |
| 525 |
tauw2=tauw; |
| 526 |
NBR2=NBR; |
| 527 |
tauc2=tauc; |
| 528 |
tauf=taufb*eps_tauf; |
| 529 |
%----- WGEM: adjustment through tauc |
| 530 |
tauc=taucb*eps_tauc; |
| 531 |
%----- WGEM: adjustment through tauk |
| 532 |
tauk=taukb*eps_tauk; |
| 533 |
%----- WGEM: adjustment through tauw |
| 534 |
tauw=tauwb*eps_tauw; |
| 535 |
|
| 536 |
end; |
| 537 |
|
| 538 |
%================================== |
| 539 |
initval; |
| 540 |
%================================== |
| 541 |
|
| 542 |
@#for i in wg |
| 543 |
n@{i}=n@{i}_iss; |
| 544 |
n@{i}_f=n@{i}_f_iss; |
| 545 |
u@{i}=u@{i}_iss; |
| 546 |
u@{i}_f=u@{i}_f_iss; |
| 547 |
Omega@{i}=Omega@{i}_iss; |
| 548 |
Omega@{i}_f=Omega@{i}_f_iss; |
| 549 |
w@{i}=w@{i}_iss; |
| 550 |
w@{i}_f=w@{i}_f_iss; |
| 551 |
dWHN@{i}=dWHN@{i}_iss; |
| 552 |
dWFN@{i}=dWFN@{i}_iss; |
| 553 |
dWFN@{i}_f=dWFN@{i}_f_iss; |
| 554 |
eps_eta@{i}=eps_eta@{i}_iss; |
| 555 |
eta@{i}=eta@{i}b*eps_eta@{i}; |
| 556 |
@#endfor |
| 557 |
|
| 558 |
@#for i in erg |
| 559 |
i@{i}=i@{i}_iss; |
| 560 |
lambda@{i}=lambda@{i}_iss; |
| 561 |
i@{i}_f=i@{i}_f_iss; |
| 562 |
lambda@{i}_f=lambda@{i}_f_iss; |
| 563 |
WE@{i}=0; |
| 564 |
eps_De_@{i}=eps_De_@{i}_iss; |
| 565 |
De_@{i}=De_@{i}b*eps_De_@{i}_iss; |
| 566 |
@#endfor |
| 567 |
|
| 568 |
@#for i in fwg |
| 569 |
i@{i}=0; |
| 570 |
lambda@{i}=0; |
| 571 |
i@{i}_f=0; |
| 572 |
lambda@{i}_f=0; |
| 573 |
@#endfor |
| 574 |
|
| 575 |
@#for i in ag |
| 576 |
@#if i in endg |
| 577 |
s@{i}=0; |
| 578 |
@#else |
| 579 |
s@{i}=s@{i}_iss; |
| 580 |
@#endif |
| 581 |
@#endfor |
| 582 |
|
| 583 |
@#for i in ag |
| 584 |
beta@{i}=beta@{i}_iss; |
| 585 |
beta@{i}_f=beta@{i}_f_iss; |
| 586 |
PD@{i}=PD@{i}_iss; |
| 587 |
c@{i}=c@{i}_iss; |
| 588 |
P@{i}=P@{i}_iss; |
| 589 |
P@{i}_f=P@{i}_f_iss; |
| 590 |
@#endfor |
| 591 |
|
| 592 |
wb = wb_iss; |
| 593 |
wb_f = wb_f_iss; |
| 594 |
Omega = Omega_iss; |
| 595 |
Omega_f = Omega_f_iss; |
| 596 |
Omega_hf = Omega_hf_iss; |
| 597 |
V = V_iss ; |
| 598 |
M = M_iss ; |
| 599 |
qq = qq_iss ; |
| 600 |
p = p_iss ; |
| 601 |
N = N_iss ; |
| 602 |
N_f = N_f_iss ; |
| 603 |
Q = Q_iss ; |
| 604 |
RR = RR_iss ; |
| 605 |
H = H_iss ; |
| 606 |
K = K_iss ; |
| 607 |
Y = Y_iss ; |
| 608 |
gdp = gdp_iss ; |
| 609 |
nx = nx_iss ; |
| 610 |
FH = FH_iss ; |
| 611 |
pi = pi_iss ; |
| 612 |
ct = ct_iss ; |
| 613 |
st = st_iss ; |
| 614 |
wshare = wshare_iss ; |
| 615 |
rr = rr_iss ; |
| 616 |
|
| 617 |
gamma = gamma_iss ; |
| 618 |
mc = mc_iss ; |
| 619 |
phii = phii_iss ; |
| 620 |
D = D_iss ; |
| 621 |
DH = DH_iss ; |
| 622 |
DF = DF_iss ; |
| 623 |
X = X_iss ; |
| 624 |
bs = bs_iss ; |
| 625 |
bsY = bsY_iss ; |
| 626 |
P00_f = P00_f_iss; |
| 627 |
|
| 628 |
eps_rhol=eps_rhol_iss; |
| 629 |
eps_rhoe=eps_rhoe_iss; |
| 630 |
eps_rhou=eps_rhou_iss; |
| 631 |
rhou=rhoub*eps_rhou_iss; |
| 632 |
rhoe=rhoeb*eps_rhoe_iss; |
| 633 |
rhol=rholb*eps_rhol_iss; |
| 634 |
eps_tauc=eps_tauc_iss; |
| 635 |
eps_tauk=eps_tauk_iss; |
| 636 |
eps_tauw=eps_tauw_iss; |
| 637 |
eps_tauf=eps_tauf_iss; |
| 638 |
tauw=tauwb*eps_tauw; |
| 639 |
tauc=taucb*eps_tauc; |
| 640 |
tauf=taufb*eps_tauf; |
| 641 |
tauk=taukb*eps_tauk; |
| 642 |
eps_theta=eps_theta_iss; |
| 643 |
eps_gh=eps_gh_iss; |
| 644 |
eps_TFP=eps_TFP_iss; |
| 645 |
eps_g=eps_g_iss; |
| 646 |
g=gb*eps_g_iss; |
| 647 |
TFP=TFPb*eps_TFP_iss; |
| 648 |
gh=ghb*eps_gh_iss; |
| 649 |
theta=thetab*eps_theta_iss; |
| 650 |
|
| 651 |
rrb=rrbb; |
| 652 |
tau1=tau1b; |
| 653 |
om1=om1b; |
| 654 |
om2=om2b; |
| 655 |
om2s=om2sb; |
| 656 |
|
| 657 |
eps_Ds=1; |
| 658 |
eps_phijs=1; |
| 659 |
Ds=Dsb*eps_Ds; |
| 660 |
phijs=phijsb*eps_phijs; |
| 661 |
|
| 662 |
eps_PensCorr_F=eps_PensCorr_F_iss; |
| 663 |
eps_PensCorr_L=eps_PensCorr_L_iss; |
| 664 |
PensCorr_F=eps_PensCorr_F_iss; |
| 665 |
PensCorr_L=eps_PensCorr_L_iss; |
| 666 |
|
| 667 |
P00 = P00_iss ; |
| 668 |
P00_foP00 = P00_foP00_iss ; |
| 669 |
|
| 670 |
DepRatio_n= |
| 671 |
@#for i in rg |
| 672 |
+P@{i} |
| 673 |
@#endfor |
| 674 |
; |
| 675 |
DepRatio_d= |
| 676 |
@#for i in wg |
| 677 |
+P@{i} |
| 678 |
@#endfor |
| 679 |
; |
| 680 |
|
| 681 |
DepRatio=DepRatio_n/DepRatio_d; |
| 682 |
|
| 683 |
ZARA=age_early+length_period*( |
| 684 |
@#for i in erg |
| 685 |
+1-i@{i} |
| 686 |
@#endfor |
| 687 |
); |
| 688 |
|
| 689 |
Ptot=Ptot_iss; |
| 690 |
Ptot_f=Ptot_f_iss; |
| 691 |
sleep=sleep_iss; |
| 692 |
du=du_iss; |
| 693 |
de=de_iss; |
| 694 |
dl=dl_iss; |
| 695 |
|
| 696 |
inA=inA_iss;%(tauw+tauf)*( |
| 697 |
%@#for i in wg |
| 698 |
%+n@{i}*w@{i}*P@{i}+n@{i}_f*w@{i}_f*P@{i}_f |
| 699 |
%@#endfor |
| 700 |
%); |
| 701 |
|
| 702 |
inB=inB_iss;%tauk*rr*( |
| 703 |
%@#for i in nbg |
| 704 |
%+1/beta@{i}^ann*s@{i-1}*P@{i} |
| 705 |
%@#endfor |
| 706 |
%)/(1+gh); |
| 707 |
|
| 708 |
in=in_iss;%tauc*ct+inA+inB+sleep; |
| 709 |
NBR=NBR_iss;%g*phii*gdp+(du+de+dl)-(in); |
| 710 |
NBRY=NBR/(phii*gdp); |
| 711 |
NBR2=NBR; |
| 712 |
tauf2=tauf; |
| 713 |
tauw2=tauw; |
| 714 |
tauc2=tauc; |
| 715 |
|
| 716 |
end; |
| 717 |
|
| 718 |
%============================== |
| 719 |
% compute initial steady state |
| 720 |
%============================== |
| 721 |
|
| 722 |
resid; |
| 723 |
steady(solve_algo=3); |
| 724 |
|
| 725 |
endval; |
| 726 |
@#for i in wg |
| 727 |
n@{i}=n@{i}_fss; |
| 728 |
n@{i}_f=n@{i}_f_fss; |
| 729 |
u@{i}=u@{i}_fss; |
| 730 |
u@{i}_f=u@{i}_f_fss; |
| 731 |
Omega@{i}=Omega@{i}_fss; |
| 732 |
Omega@{i}_f=Omega@{i}_f_fss; |
| 733 |
w@{i}=w@{i}_fss; |
| 734 |
w@{i}_f=w@{i}_f_fss; |
| 735 |
dWHN@{i}=dWHN@{i}_fss; |
| 736 |
dWFN@{i}=dWFN@{i}_fss; |
| 737 |
dWFN@{i}_f=dWFN@{i}_f_fss; |
| 738 |
eps_eta@{i}=eps_eta@{i}_fss; |
| 739 |
eta@{i}=eta@{i}b*eps_eta@{i}; |
| 740 |
@#endfor |
| 741 |
|
| 742 |
@#for i in erg |
| 743 |
i@{i}=i@{i}_fss; |
| 744 |
lambda@{i}=lambda@{i}_fss; |
| 745 |
i@{i}_f=i@{i}_f_fss; |
| 746 |
lambda@{i}_f=lambda@{i}_f_fss; |
| 747 |
WE@{i}=0; |
| 748 |
eps_De_@{i}=eps_De_@{i}_fss; |
| 749 |
De_@{i}=De_@{i}b*eps_De_@{i}_fss; |
| 750 |
@#endfor |
| 751 |
|
| 752 |
@#for i in fwg |
| 753 |
i@{i}=0; |
| 754 |
lambda@{i}=0; |
| 755 |
i@{i}_f=0; |
| 756 |
lambda@{i}_f=0; |
| 757 |
@#endfor |
| 758 |
|
| 759 |
@#for i in ag |
| 760 |
@#if i in endg |
| 761 |
s@{i}=0; |
| 762 |
@#else |
| 763 |
s@{i}=s@{i}_fss; |
| 764 |
@#endif |
| 765 |
@#endfor |
| 766 |
|
| 767 |
@#for i in ag |
| 768 |
beta@{i}=beta@{i}_fss; |
| 769 |
beta@{i}_f=beta@{i}_f_fss; |
| 770 |
PD@{i}=PD@{i}_fss; |
| 771 |
c@{i}=c@{i}_fss; |
| 772 |
P@{i}=P@{i}_fss; |
| 773 |
P@{i}_f=P@{i}_f_fss; |
| 774 |
@#endfor |
| 775 |
|
| 776 |
wb = wb_fss; |
| 777 |
wb_f = wb_f_fss; |
| 778 |
Omega = Omega_fss; |
| 779 |
Omega_f = Omega_f_fss; |
| 780 |
Omega_hf = Omega_hf_fss; |
| 781 |
V = V_fss ; |
| 782 |
M = M_fss ; |
| 783 |
qq = qq_fss ; |
| 784 |
p = p_fss ; |
| 785 |
N = N_fss ; |
| 786 |
N_f = N_f_fss ; |
| 787 |
Q = Q_fss ; |
| 788 |
RR = RR_fss ; |
| 789 |
H = H_fss ; |
| 790 |
K = K_fss ; |
| 791 |
Y = Y_fss ; |
| 792 |
gdp = gdp_fss ; |
| 793 |
nx = nx_fss ; |
| 794 |
FH = FH_fss ; |
| 795 |
pi = pi_fss ; |
| 796 |
ct = ct_fss ; |
| 797 |
st = st_fss ; |
| 798 |
wshare = wshare_fss ; |
| 799 |
rr = rr_fss ; |
| 800 |
|
| 801 |
gamma = gamma_fss ; |
| 802 |
mc = mc_fss ; |
| 803 |
phii = phii_fss ; |
| 804 |
D = D_fss ; |
| 805 |
DH = DH_fss ; |
| 806 |
DF = DF_fss ; |
| 807 |
X = X_fss ; |
| 808 |
bs = bs_fss ; |
| 809 |
bsY = bsY_fss ; |
| 810 |
P00_f = P00_f_fss; |
| 811 |
|
| 812 |
eps_rhol=eps_rhol_fss; |
| 813 |
eps_rhoe=eps_rhoe_fss; |
| 814 |
eps_rhou=eps_rhou_fss; |
| 815 |
rhou=rhoub*eps_rhou_fss; |
| 816 |
rhoe=rhoeb*eps_rhoe_fss; |
| 817 |
rhol=rholb*eps_rhol_fss; |
| 818 |
eps_tauc=eps_tauc_fss; |
| 819 |
eps_tauk=eps_tauk_fss; |
| 820 |
eps_tauw=eps_tauw_fss; |
| 821 |
eps_tauf=eps_tauf_fss; |
| 822 |
tauw=tauwb*eps_tauw; |
| 823 |
tauc=taucb*eps_tauc; |
| 824 |
tauf=taufb*eps_tauf; |
| 825 |
tauk=taukb*eps_tauk; |
| 826 |
eps_theta=eps_theta_fss; |
| 827 |
eps_gh=eps_gh_fss; |
| 828 |
eps_TFP=eps_TFP_fss; |
| 829 |
eps_g=eps_g_fss; |
| 830 |
g=gb*eps_g_fss; |
| 831 |
TFP=TFPb*eps_TFP_fss; |
| 832 |
gh=ghb*eps_gh_fss; |
| 833 |
theta=thetab*eps_theta_fss; |
| 834 |
|
| 835 |
rrb=rrbb; |
| 836 |
tau1=tau1b; |
| 837 |
om1=om1b; |
| 838 |
om2=om2b; |
| 839 |
om2s=om2sb; |
| 840 |
|
| 841 |
eps_Ds=1; |
| 842 |
eps_phijs=1; |
| 843 |
Ds=Dsb*eps_Ds; |
| 844 |
phijs=phijsb*eps_phijs; |
| 845 |
|
| 846 |
eps_PensCorr_F=eps_PensCorr_F_fss; |
| 847 |
eps_PensCorr_L=eps_PensCorr_L_fss; |
| 848 |
PensCorr_F=eps_PensCorr_F_fss; |
| 849 |
PensCorr_L=eps_PensCorr_L_fss; |
| 850 |
|
| 851 |
P00 = P00_fss ; |
| 852 |
P00_foP00 = P00_foP00_fss ; |
| 853 |
|
| 854 |
DepRatio_n= |
| 855 |
@#for i in rg |
| 856 |
+P@{i} |
| 857 |
@#endfor |
| 858 |
; |
| 859 |
DepRatio_d= |
| 860 |
@#for i in wg |
| 861 |
+P@{i} |
| 862 |
@#endfor |
| 863 |
; |
| 864 |
|
| 865 |
DepRatio=DepRatio_n/DepRatio_d; |
| 866 |
|
| 867 |
ZARA=age_early+length_period*( |
| 868 |
@#for i in erg |
| 869 |
+1-i@{i} |
| 870 |
@#endfor |
| 871 |
); |
| 872 |
|
| 873 |
Ptot= |
| 874 |
@#for i in ag |
| 875 |
+P@{i} |
| 876 |
@#endfor |
| 877 |
; |
| 878 |
Ptot_f= |
| 879 |
@#for i in ag |
| 880 |
+P@{i}_f |
| 881 |
@#endfor |
| 882 |
; |
| 883 |
|
| 884 |
sleep=(1+rr)*( |
| 885 |
@#for i in nbg |
| 886 |
+1/beta@{i}*(1-1/beta@{i}^(ann-1))*s@{i-1}*P@{i} |
| 887 |
@#endfor |
| 888 |
)/(1+gh); |
| 889 |
|
| 890 |
du=rhou*( |
| 891 |
@#for i in wg |
| 892 |
+w@{i}*u@{i}*P@{i} |
| 893 |
@#endfor |
| 894 |
); |
| 895 |
|
| 896 |
de=rhoe*( |
| 897 |
@#for i in erg |
| 898 |
+w@{i}*i@{i}*P@{i}+w@{i}_f*i@{i}_f*P@{i}_f |
| 899 |
@#endfor |
| 900 |
); |
| 901 |
|
| 902 |
dl= |
| 903 |
@#for i in rg |
| 904 |
+rhol*wb*PensCorr_L*P@{i}+rhol*wb_f*(N_f/(N+N_f))*PensCorr_F*P@{i}_f |
| 905 |
@#endfor |
| 906 |
; |
| 907 |
|
| 908 |
inA=(tauw+tauf)*( |
| 909 |
@#for i in wg |
| 910 |
+n@{i}*w@{i}*P@{i}+n@{i}_f*w@{i}_f*P@{i}_f |
| 911 |
@#endfor |
| 912 |
); |
| 913 |
|
| 914 |
inB=tauk*rr*( |
| 915 |
@#for i in nbg |
| 916 |
+1/beta@{i}^ann*s@{i-1}*P@{i} |
| 917 |
@#endfor |
| 918 |
)/(1+gh); |
| 919 |
|
| 920 |
in=tauc*ct+inA+inB+sleep; |
| 921 |
NBR=g*phii*gdp+(du+de+dl)-(in); |
| 922 |
NBRY=NBR/(phii*gdp); |
| 923 |
NBR2=NBR; |
| 924 |
tauf2=tauf; |
| 925 |
tauw2=tauw; |
| 926 |
tauc2=tauc; |
| 927 |
end; |
| 928 |
|
| 929 |
%============================ |
| 930 |
% compute final steady state |
| 931 |
%============================ |
| 932 |
|
| 933 |
resid; |
| 934 |
steady(solve_algo=3); |
| 935 |
|
| 936 |
|
| 937 |
shocks; |
| 938 |
var P00; |
| 939 |
periods 1:99; |
| 940 |
values (se_P00); |
| 941 |
|
| 942 |
@#for i in nbg |
| 943 |
var beta@{i}; |
| 944 |
periods 1:99; |
| 945 |
values (se_beta@{i}); |
| 946 |
|
| 947 |
var beta@{i}_f; |
| 948 |
periods 1:99; |
| 949 |
values (se_beta@{i}_f); |
| 950 |
|
| 951 |
var PD@{i}; |
| 952 |
periods 1:99; |
| 953 |
values (se_PD@{i}); |
| 954 |
@#endfor |
| 955 |
|
| 956 |
var P00_foP00; |
| 957 |
periods 1:99; |
| 958 |
values (se_P00_foP00); |
| 959 |
|
| 960 |
var eps_g; |
| 961 |
periods 1:99; |
| 962 |
values (se_eps_g); |
| 963 |
|
| 964 |
var eps_PensCorr_F; |
| 965 |
periods 1:99; |
| 966 |
values (se_eps_PensCorr_F); |
| 967 |
|
| 968 |
var eps_PensCorr_L; |
| 969 |
periods 1:99; |
| 970 |
values (se_eps_PensCorr_L); |
| 971 |
end; |
| 972 |
|
| 973 |
% ******************************************* |
| 974 |
% Numerical Simulation, Control Parameters |
| 975 |
% ******************************************* |
| 976 |
|
| 977 |
perfect_foresight_setup(periods=125); |
| 978 |
perfect_foresight_solver; |
| 979 |
|
| 980 |
if ~oo_.deterministic_simulation.status |
| 981 |
error('Perfect foresight simulation failed') |
| 982 |
end |