jeffgortmaker / pyblp

BLP Demand Estimation with Python
https://pyblp.readthedocs.io
MIT License
228 stars 82 forks source link

X1 formulation with only fixed effects #140

Closed giheungkim closed 1 year ago

giheungkim commented 1 year ago

Hi,

I am trying to estimate a utility specification with income effect where price enters the "non-linear" portion of the estimation and with brand_id FE. So it'd be something like

u_ij = C(brand_ids) + xi_j - \alpha*prices_j/incomei + \epsilon{ij}.

Is there anyway I can formulate X1 to just have the 'absorb' section populated and not specify any covariates? If not, do you think there is a not so beautiful solution other than putting in the full dummies that gets around this?

Thank you so much!

jeffgortmaker commented 1 year ago

Right now the only solution is something not-so-beautiful, unfortunately! See #51 for basically the same but for X3.

The simplest way to go is to have X1 have prices (and your absorb configuration), but in Problem.solve to restrict beta=0 so that linear prices don't matter at all. Let me know if that works?

giheungkim commented 1 year ago

This works perfectly. Thank you Jeff!