@@ -985,7 +985,7 @@ class BCG_complete_markets:
985985 weights = self.weights
986986 integ = lambda π: np.exp(π) * fk * q(π, k)
987987
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)
989989
990990 #=========== Optimal c ===========#
991991 # Function: Compute optimal consumption choices c
@@ -1007,10 +1007,10 @@ class BCG_complete_markets:
10071007 fk = self.f(k)
10081008
10091009 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)
10111011
10121012 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)
10141014
10151015 π = num / denom
10161016
@@ -1048,7 +1048,7 @@ def k_foc_factory(model):
10481048
10491049 @njit
10501050 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)
10521052
10531053 mul = π½ * πΌ * A * k ** (πΌ - 1) / ((w0 - k) ** (-π))
10541054 val = mul * int_k - 1
0 commit comments