pyblp.OptimalInstrumentResults.to_problem¶

OptimalInstrumentResults.
to_problem
(supply_shifter_formulation=None, demand_shifter_formulation=None)¶ Recreate the problem with estimated feasible optimal instruments.
The recreated 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 demandside instruments consist of the following:
Estimated optimal demandside 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()
.Optimal instruments for any linear demandside 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()
.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 supplyside instruments consist of the following:
Estimated optimal supplyside 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()
.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 demandside instruments will be supplemented with \(X_1^x\) and the excluded supplyside 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 demandshifters 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 demandside 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 supplyside 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 aProblem
updated to use the estimated optimal instruments. Return type
OptimalInstrumentProblem
Examples