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
forProblem
initialization. Specifically, this function affords more flexibility than passing anIntegration
configuration directly toProblem
. For example, if agents have unobserved tastes over only a subset of demand-side nonlinear product characteristics (i.e., ifsigma
inProblem.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 toProblem
, this is the number of demand-side 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