Closed ny1526 closed 1 year ago
Probably because you updated the package and something changed under the hood! This is a common issue with pickling to store data in Python -- it often isn't compatible across versions. You have two options I can think of:
ProblemResults.to_dict()
), update pyblp, and load those results. With these, you won't be able to call ProblemResults.compute_shares
directly -- you'll have to create a new Problem
, "solve" it with something like Problem.solve(sigma=results['sigma'], ..., delta=results['delta'], ..., optimization=pyblp.Optimization('return'), iteration=pyblp.Iteration('return'), ...)
, to get your results.Hope that helps.
Ah, that makes sense. I'll try that -- thank you for the detailed explanation.
Hello,
I am trying to compute counterfactual market shares by inputting new prices into a model saved in
results
. However, when I runresults.compute_shares(prices = newprices)
, I get the following error:This is a new issue for me -- I previously ran this code several months ago and did not receive this error. (I generated the model in
results
several months ago and stored/re-loaded it now.) Do you know what could be causing this?Thank you for your help!