Skip to content

Commit 3b2e687

Browse files
authored
Replace np.sum(a * b) with a @ b
1 parent 3d9f478 commit 3b2e687

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lectures/multivariate_normal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ cε = C[n, :] * ε
907907
908908
# compute the sequence of μθ and Σθ conditional on y1, y2, ..., yk
909909
μθ_hat_arr_C = np.array([np.sum(cε[:k+1]) for k in range(n)]) + μθ
910-
Σθ_hat_arr_C = np.array([np.sum(C[n, i+1:n+1] ** 2) for i in range(n)])
910+
Σθ_hat_arr_C = np.array([(C[n, i+1:n+1] @ C[n, i+1:n+1]) for i in range(n)])
911911
```
912912

913913
To confirm that these formulas give the same answers that we computed

0 commit comments

Comments
 (0)