Skip to content

Commit 2fb466c

Browse files
committed
misc
1 parent 78561ef commit 2fb466c

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

lectures/mccall_model_with_sep_markov.md

Lines changed: 15 additions & 13 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, as well as a second routine that
@@ -314,12 +316,12 @@ def get_reservation_wage(v: jnp.ndarray, model: Model) -> float:
314316
315317
# Compute accept and reject values
316318
d = 1 / (1 - β * (1 - α))
317-
accept = d * (u(w_vals, γ) + α * β * P @ v)
318-
reject = u(c, γ) + β * P @ v
319+
v_e = d * (u(w_vals, γ) + α * β * P @ v)
320+
continuation_values = u(c, γ) + β * P @ v
319321
320322
# Find where acceptance becomes optimal
321-
should_accept = accept >= reject
322-
first_accept_idx = jnp.argmax(should_accept)
323+
should_accept = v_e >= continuation_values
324+
first_accept_idx = jnp.argmax(should_accept) # first True in Boolean array
323325
324326
# If no acceptance (all False), return infinity
325327
# Otherwise return the wage at the first acceptance index

0 commit comments

Comments
 (0)