# pyblp.build_integration¶

pyblp.build_integration(integration, dimensions)

Build nodes and weights for integration over agent choice probabilities.

This function can be used to build custom agent_data for Problem initialization. Specifically, this function affords more flexibility than passing an Integration configuration directly to Problem. For example, if agents have unobserved tastes over only a subset of nonlinear product characteristics (i.e., if sigma in Problem.solve() has columns of zeros), this function can be used to build agent data with fewer columns of integration nodes than the number of unobserved product characteristics, $$K_2$$. This function can also be used to construct nodes that can be transformed into demographic variables.

To build nodes and weights for multiple markets, this function can be called multiple times, once for each market.

Parameters
• integration (Integration) – Integration configuration for how to build nodes and weights for integration.

• dimensions (int) – Number of dimensions over which to integrate, or equivalently, the number of columns of integration nodes. When an Integration configuration is passed directly to Problem, this is the number of nonlinear product characteristics, $$K_2$$.

Returns

Nodes and weights for integration over agent utilities. Fields:

• weights : (numeric) - Integration weights, $$w$$.

• nodes : (numeric) - Unobserved agent characteristics called integration nodes, $$\nu$$.

Return type

recarray

Examples