pyblp.ProblemResults.compute_demand_jacobians

ProblemResults.compute_demand_jacobians(name='prices', market_id=None)

Estimate matrices of derivatives of demand with respect to a variable, \(x\).

In market \(t\), the value in row \(j\) and column \(k\) is

(1)\[\frac{\partial s_{jt}}{\partial x_{kt}}.\]
Parameters
  • name (str, optional) – Name of the variable, \(x\). By default, \(x = p\), prices.

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

Returns

Estimated \(J_t \times J_t\) matrices of derivatives of demand. If market_id was not specified, matrices are estimated in each market \(t\) and stacked. Columns for a market are in the same order as products for the market. If a market has fewer products than others, extra columns will contain numpy.nan.

Return type

ndarray

Examples