pyblp.OptimalInstrumentResults.to_problem

OptimalInstrumentResults.to_problem(supply_shifter_formulation=None, demand_shifter_formulation=None)

Re-create the problem with estimated feasible optimal instruments.

The re-created problem will be exactly the same, except that instruments will be replaced with estimated feasible optimal instruments.

Note

Most of the explanation here is only important if a supply side was estimated.

The optimal excluded demand-side instruments consist of the following:

  1. Estimated optimal demand-side instruments for \(\theta\), \(Z_D^\textit{Opt}\), excluding columns of instruments for any exogenous linear parameters that were not concentrated out, but rather included in \(\theta\) by Problem.solve().

  2. Optimal instruments for any linear demand-side parameters on endogenous product characteristics, \(\alpha\), which were concentrated out and hence not included in \(\theta\). These optimal instruments are simply an integral of the endogenous product characteristics, \(X_1^p\), over the joint density of \(\xi\) and \(\omega\). It is only possible to concentrate out \(\alpha\) when there isn’t a supply side, so the approximation of these optimal instruments is simply \(X_1^p\) evaluated at the constant vector of expected prices, \(E[p \mid Z]\), specified in ProblemResults.compute_optimal_instruments().

  3. If a supply side was estimated, any supply shifters, which are by default formulated by OptimalInstrumentResults.supply_shifter_formulation: all characteristics in \(X_3\) not in \(X_1\).

Similarly, if a supply side was estimated, the optimal excluded supply-side instruments consist of the following:

  1. Estimated optimal supply-side instruments for \(\theta\), \(Z_S^\textit{Opt}\), excluding columns of instruments for any exogenous linear parameters that were not concentrated out, but rather included in \(\theta\) by Problem.solve().

  2. If a supply side was estimated, any demand shifters, which are by default formulated by OptimalInstrumentResults.demand_shifter_formulation: all characteristics in \(X_1^x\) not in \(X_3\).

As usual, the excluded demand-side instruments will be supplemented with \(X_1^x\) and the excluded supply-side instruments will be supplemented with \(X_3\). The same fixed effects configured in Problem will be absorbed.

Warning

If a supply side was estimated, the addition of supply- and demand-shifters may create collinearity issues. Make sure to check that shifters and other product characteristics are not collinear.

Parameters
  • supply_shifter_formulation (Formulation, optional) – Formulation configuration for supply shifters to be included in the set of optimal demand-side instruments. This is only used if a supply side was estimated. Intercepts will be ignored. By default, OptimalInstrumentResults.supply_shifter_formulation is used.

  • demand_shifter_formulation (Formulation, optional) – Formulation configuration for demand shifters to be included in the set of optimal supply-side instruments. This is only used if a supply side was estimated. Intercepts will be ignored. By default, OptimalInstrumentResults.demand_shifter_formulation is used.

Returns

OptimalInstrumentProblem, which is a Problem updated to use the estimated optimal instruments.

Return type

OptimalInstrumentProblem

Examples