Skip to content

Commit

Permalink
BUG: raise an error if integration is attempted over no unobserved he…
Browse files Browse the repository at this point in the history
…terogeneity
  • Loading branch information
jeffgortmaker committed Jul 23, 2022
1 parent 0626c96 commit 8210fdd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyblp/primitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,10 @@ def __new__(
else:
if not isinstance(integration, Integration):
raise ValueError("integration must be None or an Integration instance.")
if parameters.nonzero_sigma_index.sum() == 0:
raise ValueError(
"There is no unobserved heterogeneity over which to integrate, so integration must be None."
)

# duplicate observations by as many rows as there are built nodes
micro_ids, nodes, weights = integration._build_many(
Expand Down

0 comments on commit 8210fdd

Please sign in to comment.