pyblp.build_id_data(T, J, F)

Build a balanced panel of market and firm IDs.

This function can be used to build id_data for Simulation initialization.

  • T (int) – Number of markets.

  • J (int) – Number of products in each market.

  • F (int) – Number of firms. If J is divisible by F, firms produce J / F products in each market. Otherwise, firms with smaller IDs will produce excess products.


IDs that associate products with markets and firms. Each of the T * J rows corresponds to a product. Fields:

  • market_ids : (object) - Market IDs that take on values from 0 to T - 1.

  • firm_ids : (object) - Firm IDs that take on values from 0 to F - 1.

Return type