Skip to content

Commit 60a9857

Browse files
jstacclaude
andauthored
misc (#703)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 83b7d39 commit 60a9857

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

lectures/mccall_model_with_sep_markov.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,20 @@ $$
9696

9797
where $\{Z_t\}$ is IID and standard normal.
9898

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.
10599

106100
Below we will always choose $\rho \in (0, 1)$.
107101

108102
This means that the wage process will be positively correlated: the higher the current
109103
wage offer, the more likely we are to get a high offer tomorrow.
110104

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+
111113

112114

113115
### Value Functions
@@ -259,9 +261,9 @@ def T(v: jnp.ndarray, model: Model) -> jnp.ndarray:
259261
"""
260262
n, w_vals, P, P_cumsum, β, c, α, γ = model
261263
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)
265267
```
266268

267269
Here's a routine for value function iteration.
@@ -312,10 +314,10 @@ def get_reservation_wage(v: jnp.ndarray, model: Model) -> float:
312314
# Compute accept and reject values
313315
d = 1 / (1 - β * (1 - α))
314316
v_e = d * (u(w_vals, γ) + α * β * P @ v)
315-
continuation_value = u(c, γ) + β * P @ v
317+
continuation_values = u(c, γ) + β * P @ v
316318
317319
# Find where acceptance becomes optimal
318-
accept_indices = v_e >= continuation_value
320+
accept_indices = v_e >= continuation_values
319321
first_accept_idx = jnp.argmax(accept_indices) # index of first True
320322
321323
# If no acceptance (all False), return infinity

0 commit comments

Comments
 (0)