Git Product home page Git Product logo

Comments (3)

jeffgortmaker avatar jeffgortmaker commented on August 10, 2024

I'm guessing the prices solved for by the simulation have a few zeros. In practice, log terms like this create trouble for numerical estimation routines because a few "extreme" values can create errors. Without more info I can't say much more.

from pyblp.

amandeep0 avatar amandeep0 commented on August 10, 2024

Actually, I did not even solve for prices. I just initialized the simulation class, using the example in docs, but with log prices instead.

id_data = pyblp.build_id_data(T=50, J=20, F=10)
integration = pyblp.Integration('product', 9)
simulation = pyblp.Simulation(
product_formulations=(
pyblp.Formulation('1 + log(prices) + x'),
pyblp.Formulation('0 + x'),
pyblp.Formulation('0 + x + z')
),
beta=[1, -2, 2],
sigma=1,
gamma=[1, 4],
product_data=id_data,
integration=integration,
seed=0
)

from pyblp.

jeffgortmaker avatar jeffgortmaker commented on August 10, 2024

I see. I think you're using a version of the package (may just be the latest version on pip) where prices and shares are initialized as zero as a placeholder until they can be replaced by Simulation.solve. So this gives the error.

I've overhauled the Simulation class recently (actually in response to #29 that you brought up). This should no longer be a problem in the dev version of the code where prices and shares are initialized as (nonzero) draws from uniform distributions.

Note that my original thoughts about including logs still might be an issue for you.

from pyblp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.