pyblp.ProblemResults.compute_hhi

ProblemResults.compute_hhi(firm_ids=None, shares=None, market_id=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.

  • market_id (object, optional) – ID of the market in which to compute the index. By default, indices are computed in all markets and stacked.

Returns

Estimated Herfindahl-Hirschman Indices, \(\text{HHI}\). If market_ids was not specified, rows are in the same order as Problem.unique_market_ids.

Return type

ndarray

Examples