pyRVtest.Problem

class pyRVtest.Problem(cost_formulation, instrument_formulation, product_data, demand_results, model_formulations=None, markup_data=None)

A firm conduct testing-type problem.

This class is initialized using the relevant data and formulations, and solved with Problem.solve().

Parameters
  • cost_formulation (Formulation) – Formulation is a list of the variables for observed product characteristics. All observed cost shifters included in this formulation must be variables in the product_data. To use a constant, one would replace 0 with 1. To absorb fixed effects, specify absorb = ‘C(variable)’, where the variable must also be in the product_data. Including this option implements fixed effects absorption using [PYHDFE](https://github.com/jeffgortmaker/pyhdfe), a companion package to PyBLP.

  • instrument_formulation (Formulation or sequence of Formulation) –

    Formulation is list of the variables used as excluded instruments for testing. For each instrument formulation, there should never be a constant. The user can specify as many instrument formulations as desired. All instruments must be variables in product_data.

    Note

    Our instrument naming conventions differ from PyBLP. With PyBLP, one specifies the excluded instruments for demand estimation via a naming convention in the product_data: each excluded instrument for demand estimation begins with “demand_instrument” followed by a number ( i.e., demand_instrument0). In pyRVtest, you specify directly the names of the variables in the product_data that you want to use as excluded instruments for testing (i.e., if you want to test with one instrument using the variable in the product_data named, “transportation_cost” one could specify pyRVtest.Formulation(‘0 + transportation_cost’).

  • model_formulations (sequence of ModelFormulation) – ModelFormulation defines the models that the researcher wants to test. There must be at least two instances of ModelFormulation specified to run the firm conduct testing procedure.

  • product_data (structured array-like) – This is the data containing product and market observable characteristics, as well as instruments.

  • demand_results` (structured array-like) – The results object returned by pyblp.solve.

Methods

solve([demand_adjustment, clustering_adjustment])

Solve the problem.