|
96 | 96 |
|
97 | 97 | where $\{Z_t\}$ is IID and standard normal. |
98 | 98 |
|
99 | | -Informally, we set $W_t = \exp(Z_t)$. |
100 | | - |
101 | | -In practice, we |
102 | | - |
103 | | -* discretize the AR1 process using {ref}`Tauchen's method <fm_ex3>` and |
104 | | -* take the exponential of the resulting wage offer values. |
105 | 99 |
|
106 | 100 | Below we will always choose $\rho \in (0, 1)$. |
107 | 101 |
|
108 | 102 | This means that the wage process will be positively correlated: the higher the current |
109 | 103 | wage offer, the more likely we are to get a high offer tomorrow. |
110 | 104 |
|
| 105 | +To go from the AR1 process to the wage offer process, we set $W_t = \exp(X_t)$. |
| 106 | + |
| 107 | +Actually, in practice, we approximate this wage process as follows: |
| 108 | + |
| 109 | +* discretize the AR1 process using {ref}`Tauchen's method <fm_ex3>` and |
| 110 | +* take the exponential of the resulting wage offer values. |
| 111 | + |
| 112 | + |
111 | 113 |
|
112 | 114 |
|
113 | 115 | ### Value Functions |
@@ -259,9 +261,9 @@ def T(v: jnp.ndarray, model: Model) -> jnp.ndarray: |
259 | 261 | """ |
260 | 262 | n, w_vals, P, P_cumsum, β, c, α, γ = model |
261 | 263 | d = 1 / (1 - β * (1 - α)) |
262 | | - accept = d * (u(w_vals, γ) + α * β * P @ v) |
263 | | - reject = u(c, γ) + β * P @ v |
264 | | - return jnp.maximum(accept, reject) |
| 264 | + v_e = d * (u(w_vals, γ) + α * β * P @ v) |
| 265 | + h = u(c, γ) + β * P @ v |
| 266 | + return jnp.maximum(v_e, h) |
265 | 267 | ``` |
266 | 268 |
|
267 | 269 | Here's a routine for value function iteration. |
@@ -312,10 +314,10 @@ def get_reservation_wage(v: jnp.ndarray, model: Model) -> float: |
312 | 314 | # Compute accept and reject values |
313 | 315 | d = 1 / (1 - β * (1 - α)) |
314 | 316 | v_e = d * (u(w_vals, γ) + α * β * P @ v) |
315 | | - continuation_value = u(c, γ) + β * P @ v |
| 317 | + continuation_values = u(c, γ) + β * P @ v |
316 | 318 |
|
317 | 319 | # Find where acceptance becomes optimal |
318 | | - accept_indices = v_e >= continuation_value |
| 320 | + accept_indices = v_e >= continuation_values |
319 | 321 | first_accept_idx = jnp.argmax(accept_indices) # index of first True |
320 | 322 |
|
321 | 323 | # If no acceptance (all False), return infinity |
|
0 commit comments