Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lectures/back_prop.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ key = random.key(0)

def train(params, grid, f_val, key, num_epochs=300):
for epoch in range(num_epochs):
key, _ = random.split(key)
random_permutation = random.permutation(random.key(1), indices)
key, subkey = random.split(key)
random_permutation = random.permutation(subkey, indices)
for x, y in zip(grid[random_permutation], f_val[random_permutation]):
params = update_la(params, x, y)

Expand Down
8 changes: 4 additions & 4 deletions lectures/endogenous_lake.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ mcm = create_mccall_model(w_vec=w_vec, p_vec=p_vec)
V, U = solve_mccall_model(mcm)
w_idx = jnp.searchsorted(V - U, 0)
w_bar = jnp.where(w_idx == len(V), jnp.inf, mcm.w_vec[w_idx])
λ = mcm.γ * jnp.sum(p_vec * (w_vec > w_bar))
print(f"Job finding rate at default paramters ={λ}.")
λ = mcm.γ * jnp.sum(p_vec * (w_vec >= w_bar))
print(f"Job finding rate at default parameters ={λ}.")
```


Expand Down Expand Up @@ -461,7 +461,7 @@ def compute_optimal_quantities(
w_bar = jnp.where(w_idx == len(V), jnp.inf, mcm.w_vec[w_idx])

# Compute job finding rate
λ = economy.γ * jnp.sum(p_vec * (w_vec - τ > w_bar))
λ = economy.γ * jnp.sum(p_vec * (w_vec - τ >= w_bar))

return w_bar, λ, V, U
```
Expand Down Expand Up @@ -493,7 +493,7 @@ def compute_steady_state_quantities(
u, e = rate_steady_state(model)

# Compute expected lifetime value conditional on being employed.
mask = (w_vec - τ > w_bar)
mask = (w_vec - τ >= w_bar)
w = jnp.sum(V * p_vec * mask) / jnp.sum(p_vec * mask)
# Compute steady state welfare.
welfare = e * w + u * U
Expand Down
2 changes: 1 addition & 1 deletion lectures/multi_hyper.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ def bivariate_normal(x, y, μ, Σ, i, j):
```{code-cell} ipython3
@jit
def count(vec1, vec2, n):
size = sample.shape[0]
size = vec1.shape[0]

count_mat = np.zeros((n+1, n+1))
for i in prange(size):
Expand Down
4 changes: 2 additions & 2 deletions lectures/stats_examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ We compute the mean and variance to be

$$
\begin{aligned}
\mathbb{E}(X) & = \frac{k(1-p)}{p} \\
\mathbb{V}(X) & = \frac{k(1-p)}{p^2}
\mathbb{E}(X) & = \frac{r(1-p)}{p} \\
\mathbb{V}(X) & = \frac{r(1-p)}{p^2}
\end{aligned}
$$

Expand Down
Loading