Comments (3)
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.
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.
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)
- How to construct a separate pair of micro moments for each market HOT 4
- X1 formulation with only fixed effects HOT 2
- Memory issues with pyblp.differentiation_instruments HOT 4
- Demand Jacobian, markup term and first order conditions HOT 2
- Micromoments for choices within individuals HOT 10
- Boostrap the change in consumer surplus under a counterfactual scenario HOT 3
- Question: When using pyblp.parallel() to run problem.solve(), How can I make sure that each partition has enough RAM? HOT 9
- questions on price elasticity and convergence HOT 2
- Computing counterfactual shares HOT 2
- questions about different markets have different numbers of products HOT 1
- Questions on how to run simulation with different product attributes to different agents HOT 10
- Question - Is there a way to incorporate FEs in Simulation? HOT 4
- Supply-side moments for subset of markets HOT 3
- Trouble with importing PyBLP HOT 2
- ProblemResults question HOT 6
- Coding base level in categorical variables in pyblp HOT 2
- divide by zero error in "ProblemResults.compute_consumer_surpluses(eliminate_product_ids)" HOT 7
- ValueError ("The detected shape was (3,) + inhomogeneous part.") when running simulation.ipynb from the tutorial HOT 2
- Problem with including log-normally distributed random coefficients on price HOT 4
- Question: Most Efficient Way of Producing LaTeX Tables of PyBLP Results and Estimates HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyblp.