Skip to content

Commit

Permalink
ENH: replace simple matrix inversion with system solving
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgortmaker committed May 6, 2018
1 parent 69d5104 commit 031331b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyblp/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def compute_eta(self, ownership, utilities_jacobian, prices=None):
shares = probabilities @ self.agents.weights
shares_jacobian = self.compute_shares_by_characteristic_jacobian(utilities_jacobian, probabilities)
try:
return -scipy.linalg.inv(ownership * shares_jacobian) @ shares
return -scipy.linalg.solve(ownership * shares_jacobian, shares)
except ValueError:
return np.full_like(shares, np.nan)

Expand Down

0 comments on commit 031331b

Please sign in to comment.