From 3b2e687a903261b66f66d43ad9e58686be2dc711 Mon Sep 17 00:00:00 2001 From: suda-yuga Date: Wed, 25 Jun 2025 20:38:33 +0900 Subject: [PATCH 1/2] Replace np.sum(a * b) with a @ b --- lectures/multivariate_normal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/multivariate_normal.md b/lectures/multivariate_normal.md index 8311ba5da..a1e8736db 100644 --- a/lectures/multivariate_normal.md +++ b/lectures/multivariate_normal.md @@ -907,7 +907,7 @@ cε = C[n, :] * ε # compute the sequence of μθ and Σθ conditional on y1, y2, ..., yk μθ_hat_arr_C = np.array([np.sum(cε[:k+1]) for k in range(n)]) + μθ -Σθ_hat_arr_C = np.array([np.sum(C[n, i+1:n+1] ** 2) for i in range(n)]) +Σθ_hat_arr_C = np.array([(C[n, i+1:n+1] @ C[n, i+1:n+1]) for i in range(n)]) ``` To confirm that these formulas give the same answers that we computed From 1f8eff24300de33f12bb9f1dd268a743d61f5c13 Mon Sep 17 00:00:00 2001 From: suda-yuga Date: Mon, 30 Jun 2025 18:54:33 +0900 Subject: [PATCH 2/2] Remove unnecessary parentheses.md --- lectures/multivariate_normal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lectures/multivariate_normal.md b/lectures/multivariate_normal.md index a1e8736db..a47acc0cf 100644 --- a/lectures/multivariate_normal.md +++ b/lectures/multivariate_normal.md @@ -907,7 +907,7 @@ cε = C[n, :] * ε # compute the sequence of μθ and Σθ conditional on y1, y2, ..., yk μθ_hat_arr_C = np.array([np.sum(cε[:k+1]) for k in range(n)]) + μθ -Σθ_hat_arr_C = np.array([(C[n, i+1:n+1] @ C[n, i+1:n+1]) for i in range(n)]) +Σθ_hat_arr_C = np.array([C[n, i+1:n+1] @ C[n, i+1:n+1] for i in range(n)]) ``` To confirm that these formulas give the same answers that we computed