pyblp.ProblemResults.compute_prices

ProblemResults.compute_prices(firm_ids=None, ownership=None, costs=None, prices=None, iteration=None, constant_costs=True, market_id=None)

Estimate equilibrium prices after firm or cost changes, \(p^*\).

Note

To compute equilibrium prices (and shares) associated with a more complicated counterfactual, a Simulation for the counterfactual can be initialized with the estimated parameters, structural errors, and marginal costs from these results, and then solved with Simulation.replace_endogenous(). The returned SimulationResults gives more information about the contraction than this method, such as the number of contraction evaluations. It also automatically reports first and second order conditions.

Prices are computed in each market by iterating over the \(\zeta\)-markup contraction in (52):

(1)\[p^* \leftarrow c^* + \zeta^*(p^*),\]

in which the markup term from (49) is

(2)\[\zeta^*(p^*) = \Lambda^{-1}(p^*)[\mathscr{H}^* \odot \Gamma(p^*)]'(p^* - c^*) - \Lambda^{-1}(p^*)s(p^*)\]

where \(\mathscr{H}^*\) is the ownership matrix associated with firm changes.

Parameters
  • firm_ids (array-like, optional) – Potentially changed firm IDs. By default, the unchanged firm_ids field of product_data in Problem will be used.

  • ownership (array-like, optional) – Potentially changed ownership matrices. By default, standard ownership matrices based on firm_ids will be used unless the ownership field of product_data in Problem was specified.

  • costs (array-like) – Potentially changed marginal costs, \(c^*\). By default, unchanged marginal costs are computed with ProblemResults.compute_costs(). Costs under a changed ownership structure can be computed by specifying the firm_ids or ownership arguments of ProblemResults.compute_costs(). If marginal costs depend on prices through market shares, they will be updated to reflect different prices during each iteration of the routine. Updated marginal costs can be obtained by instead using Simulation.replace_endogenous().

  • prices (array-like, optional) – Prices at which the fixed point iteration routine will start. By default, unchanged prices, \(p\), are used as starting values. Other reasonable starting prices include the approximate equilibrium prices computed by ProblemResults.compute_approximate_prices().

  • iteration (Iteration, optional) – Iteration configuration for how to solve the fixed point problem in each market. By default, Iteration('simple', {'atol': 1e-12}) is used.

  • constant_costs (bool, optional) – Whether to assume that marginal costs, \(c\), remain constant as equilibrium prices and shares change. By default this is True, which means that firms treat marginal costs as constant (equal to costs) when setting prices. This assumption is implicit in how ProblemResults.compute_costs() computes marginal costs. If set to False, marginal costs will be allowed to adjust if shares was included in the formulation for \(X_3\) in Problem.

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

Returns

Estimates of equilibrium prices after any firm or cost changes, \(p^*\).

Return type

ndarray

Examples