Download the Jupyter Notebook for this section: integration.ipynb

Integration Example

[1]:
import pyblp

pyblp.__version__
[1]:
'1.1.0'

In this example, we’ll build a Monte Carlo configuration with 1,000 draws for each market and a fixed seed.

[2]:
integration = pyblp.Integration('monte_carlo', size=1000, specification_options={'seed': 0})
integration
[2]:
Configured to construct nodes and weights with Monte Carlo simulation with options {seed: 0}.

Depending on the dimension of the integration problem, a level six sparse grid configuration may have a similar number of nodes. However, even if there are fewer nodes, it is likely to perform better in the BLP problem. Sparse grid construction is deterministic, so a seed is not needed to fix the grid every time we use this configuration.

[3]:
integration = pyblp.Integration('grid', size=7)
integration
[3]:
Configured to construct nodes and weights in a sparse grid according to the level-7 Gauss-Hermite rule with options {}.