pyRVtest.ModelFormulation
- class pyRVtest.ModelFormulation(model_downstream=None, model_upstream=None, ownership_downstream=None, ownership_upstream=None, custom_model_specification=None, vertical_integration=None, unit_tax=None, advalorem_tax=None, advalorem_payer=None, cost_scaling=None, kappa_specification_downstream=None, kappa_specification_upstream=None, user_supplied_markups=None)
Configuration for designing matrices and absorbing fixed effects.
For each model, the user can specify the downstream and upstream (optional) models, the downstream and upstream ownership structure, a custom model and markup formula, and vertical integration. The user can also choose to forgo markup computation and specify their own markups with user_supplied_markups. Additionally, there are specifications related to testing conduct with taxes.
There is a built-in library of models that the researcher can choose from.
Here, we have another difference with PyBLP. In PyBLP, if one wants to build an ownership matrix, there must be a variable called firm_id in the product_data. With pyRVtest, the researcher can pass any variable in the product_data as ownership_downstream and from this, the ownership matrix in each market will be built.
Note
We are working on adding additional models to this library as well as options for the researcher to specify their own markup function.)
- Parameters
model_downstream (str, optional) – The model of conduct for downstream firms (or if no vertical structure, the model of conduct). One of “bertrand”, “cournot”, “monopoly”, “perfect_competition”, or “other”.
model_upstream (str, optional) – The model of conduct for upstream firms. One of “bertrand”, “cournot”, “monopoly”, “perfect_competition”, or “other”.
ownership_downstream (str, optional) – Column indicating which firm ids to use for ownership matrix construction for downstream firms.
ownership_upstream (str, optional) – Column indicating which firm ids to use for ownership matrix construction for upstream firms.
custom_model_specification (dict, optional) – A dictionary containing an optional custom markup formula specified by the user. The specified function must consist of objects computed within the package.
vertical_integration (str, optional) – The column name for the data column which indicates the vertical ownership structure.
unit_tax (str, optional) – The column name for the vector containing information on unit taxes.
advalorem_tax (str, optional) – The column name for the vector containing information on advalorem taxes.
advalorem_payer (str, optional) – A string indicating who pays for the advalorem tax in the given model.
cost_scaling (str, optional) – The column name for the cost scaling parameter.
kappa_specification_downstream (Union[str, Callable[[Any, Any], float]]], optional) – Information on the degree of cooperation among downstream firms for each market.
kappa_specification_upstream (Union[str, Callable[[Any, Any], float]]], optional) – Information on the degree of cooperation among upstream firms for each market.
user_supplied_markups (str, optional) – The name of the column containing user-supplied markups.