@@ -985,7 +985,7 @@ class BCG_complete_markets:
|
985 | 985 | weights = self.weights |
986 | 986 | integ = lambda 𝜖: np.exp(𝜖) * fk * q(𝜖, k) |
987 | 987 | |
988 | | - return -k + np.sum(weights * integ(self.points_integral)) / np.sqrt(np.pi) |
| 988 | + return -k + (weights @ integ(self.points_integral)) / np.sqrt(np.pi) |
989 | 989 | |
990 | 990 | #=========== Optimal c ===========# |
991 | 991 | # Function: Compute optimal consumption choices c |
@@ -1007,10 +1007,10 @@ class BCG_complete_markets:
|
1007 | 1007 | fk = self.f(k) |
1008 | 1008 | |
1009 | 1009 | c1 = lambda 𝜖: (w1(𝜖) + np.exp(𝜖)*fk)*q(𝜖,k) |
1010 | | - denom = np.sum(weights * c1(self.points_integral)) / np.sqrt(np.pi) + (w0 - k) |
| 1010 | + denom = (weights @ c1(self.points_integral)) / np.sqrt(np.pi) + (w0 - k) |
1011 | 1011 | |
1012 | 1012 | w11q = lambda 𝜖: w11(𝜖)*q(𝜖,k) |
1013 | | - num = w10 + 𝜃10 * V(k) + np.sum(weights * w11q(self.points_integral)) / np.sqrt(np.pi) |
| 1013 | + num = w10 + 𝜃10 * V(k) + (weights @ w11q(self.points_integral)) / np.sqrt(np.pi) |
1014 | 1014 | |
1015 | 1015 | 𝜂 = num / denom |
1016 | 1016 | |
@@ -1048,7 +1048,7 @@ def k_foc_factory(model):
|
1048 | 1048 | |
1049 | 1049 | @njit |
1050 | 1050 | def k_foc(k, 𝜒1, 𝜒2): |
1051 | | - int_k = np.sum(weights * integrand(points_integral, 𝜒1, 𝜒2, k=k)) / np.sqrt(np.pi) |
| 1051 | + int_k = (weights @ integrand(points_integral, 𝜒1, 𝜒2, k=k)) / np.sqrt(np.pi) |
1052 | 1052 | |
1053 | 1053 | mul = 𝛽 * 𝛼 * A * k ** (𝛼 - 1) / ((w0 - k) ** (-𝜓)) |
1054 | 1054 | val = mul * int_k - 1 |
|