pyblp.ProblemResults.compute_hhi

ProblemResults.compute_hhi(firm_ids=None, shares=None)

Estimate Herfindahl-Hirschman Indices, \(\text{HHI}\).

The index in market \(t\) is

(1)\[\text{HHI} = 10,000 \times \sum_{f=1}^{F_t} \left(\sum_{j \in \mathscr{J}_{ft}} s_j\right)^2.\]
Parameters
  • firm_ids (array-like, optional) – Firm IDs. By default, the unchanged firm_ids field of product_data in Problem will be used.

  • shares (array-like, optional) – Shares, \(s\), such as those computed by ProblemResults.compute_shares(). By default, unchanged shares are used.

Returns

Estimated Herfindahl-Hirschman Indices, \(\text{HHI}\), for all markets. Rows are in the same order as Problem.unique_market_ids.

Return type

ndarray

Examples