// Solve the linear system rather thatn invert everything
A = tau_sigma_inv + P_omega_inv @ self.P
b = tau_sigma_inv.dot(self.pi) + P_omega_inv.dot(self.Q)
x = np.linalg.solve(A, b)
return pd.Series(x.flatten(), index=self.tickers)
def bl_cov(self):
After Change
if self._A is None:
self._A = (self.P @ self._tau_sigma_P) + self.omega
b = self.Q - self.P @ self.pi
post_rets = self.pi + self._tau_sigma_P @ np.linalg.solve(self._A, b)
return pd.Series(post_rets.flatten(), index=self.tickers)
def bl_cov(self):