pyblp.Simulation.solve¶

Simulation.
solve
(firm_ids=None, ownership=None, prices=None, iteration=None, error_behavior='raise')¶ Compute synthetic prices and shares.
Prices and shares are computed in each market by iterating over the \(\zeta\)markup contraction in (42):
(1)¶\[p \leftarrow c + \zeta(p).\]Note
To create a simulation under perfect (instead of Bertrand) competition, use an
Iteration
configuration withmethod='return'
. This will set prices equal to the default starting values for the iteration routine, which are marginal costs.Note
This method supports
parallel()
processing. If multiprocessing is used, marketbymarket computation of prices and shares will be distributed among the processes. Parameters
firm_ids (arraylike, optional) – Potentially changed firms IDs. By default, the
firm_ids
field ofproduct_data
inSimulation
will be used.ownership (arraylike, optional) – Custom ownership matrices. By default, standard ownership matrices based on
firm_ids
will be used unless theownership
field ofproduct_data
inSimulation
was specified.prices (arraylike, optional) – Prices at which the fixed point iteration routine will start. By default, marginal costs, \(c\), are used as starting values.
iteration (Iteration, optional) –
Iteration
configuration for how to solve the fixed point problem. By default,Iteration('simple', {'atol': 1e12})
is used. Analytic Jacobians are not supported for solving this system.error_behavior (str, optional) –
How to handle errors when computing prices and shares. For example, the fixed point routine may not converge if the effects of nonlinear parameters on price overwhelm the linear parameter on price, which should be sufficiently negative. The following behaviors are supported:
'raise'
(default)  Raise an exception.'warn'
 Use the last computed prices and shares. If the fixed point routine fails to converge, these are the last prices and shares computed by the routine. If there are other issues, these are the starting prices and their associated shares.
 Returns
SimulationResults
of the solved simulation. Return type
SimulationResults
Examples