Closed jakob-ditfurth closed 1 year ago
The reason is that you're underidentified. There are more parameters (4) than moments (2 or 3 depending on the code).
In your Python code, the reason you only have "MD" = 2 moments (corresponding to "included" instruments 1 and x) is that you specified "demand_instrument0", not "demand_instruments0", so pyblp isn't identifying your excluded instrument.
But even after fixing that (and I think it's fixed in your R code?), you still only have MD = 3 moments for 4 parameters. Regardless of the value for sigma, we can find linear parameters (beta) that set the objective equal to zero, and that's what pyblp does. This is why it just returns after a single optimization iteration -- it found the minimum objective value.
You need an extra instrument ("demand_instruments1") for sigma -- see e.g. Gandhi and Houde's differentiation IVs, various forms of which pyblp can construct.
Thanks a ton, I did not realize that my problem was underidentified. Thanks for the reference and thanks for pointing this out. I managed to fix this now.
Thanks!
Hi,
I am running into a weird problem with pyBLP on R and am not able to debug it.
I am simulating quite standard data with 1 true random coefficient on prices:
Now, I apply the BLP solver to this data
Then, I get an output from results as follows:
Please note that the nonlinear coefficient estimate is equal to the inital value (sigma = 1). I have no idea why that is the case, I cannot seem to fix it. Do you have an idea?
To make sure that this is not specific to R, I have redone the same thing in python and got the same result.
I am attaching the code that I used in python - it is basically the same as R.
Many thanks, Jakob no_sigma_est_python_code.txt