Skip to content

Commit

Permalink
BUG: detect singularity for micro moment covariances, not part covari…
Browse files Browse the repository at this point in the history
…ances
  • Loading branch information
jeffgortmaker committed Aug 18, 2022
1 parent dddd140 commit 7c168b5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pyblp/economies/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -928,12 +928,10 @@ def market_factory(
# fill the lower triangle
lower_indices = np.tril_indices(moments.PM, -1)
parts_covariances[lower_indices] = parts_covariances.T[lower_indices]
self._detect_singularity(
parts_covariances, "the estimated covariance matrix of micro moment parts"
)

# compute micro moment covariances with the delta method
micro_covariances = micro_gradients @ parts_covariances @ micro_gradients.T
self._detect_singularity(micro_covariances, "the estimated covariance matrix of micro moments")

# detect collinearity between micro moment parts
if detect_micro_collinearity:
Expand Down

0 comments on commit 7c168b5

Please sign in to comment.