Skip to content

Commit 0d2647d

Browse files
committed
REPLICA: PR 149 for testing
1 parent 30fe5e9 commit 0d2647d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lectures/arellano.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,7 @@ def compute_q(v_c, v_d, q, params, arrays):
421421
for B_idx in range(len(B_grid)):
422422
for y_idx in range(len(y_grid)):
423423
# Compute default probability and corresponding bond price
424-
default_states = 1.0 * (v_c[B_idx, :] < v_d)
425-
delta = np.dot(default_states, P[y_idx, :])
424+
delta = P[y_idx, v_c[B_idx, :] < v_d].sum()
426425
q[B_idx, y_idx] = (1 - delta ) / (1 + r)
427426
```
428427

@@ -769,8 +768,7 @@ zz = np.empty_like(v_c)
769768
770769
for B_idx in range(B_grid_size):
771770
for y_idx in range(y_grid_size):
772-
default_states = 1.0 * (v_c[B_idx, :] < v_d)
773-
zz[B_idx, y_idx] = np.dot(default_states, P[y_idx, :])
771+
zz[B_idx, y_idx] = P[y_idx, v_c[B_idx, :] < v_d].sum()
774772
775773
# Create figure
776774
fig, ax = plt.subplots(figsize=(10, 6.5))

0 commit comments

Comments
 (0)