pyblp.SimulationResults

class pyblp.SimulationResults

Results of a solved simulation of synthetic BLP data.

The SimulationResults.to_problem() method can be used to convert the full set of simulated data (along with some basic default instruments) and configured information into a Problem.

simulation

Simulation that created these results.

Type

Simulation

product_data

Simulated Simulation.product_data with product characteristics replaced so as to be consistent with the true parameters. If Simulation.replace_endogenous() was used to create these results, prices and marketshares were replaced. If Simulation.replace_exogenous() was used, exogenous characteristics were replaced instead.

Type

recarray

computation_time

Number of seconds it took to compute prices and marketshares.

Type

float

fp_converged

Flags for convergence of the iteration routine used to compute prices or \(\delta\) (depending on the method used to create these results) in each market. Flags are in the same order as Simulation.unique_market_ids.

Type

ndarray

fp_iterations

Number of major iterations completed by the iteration routine used to compute prices or \(\delta\) in each market. Counts are in the same order as Simulation.unique_market_ids.

Type

ndarray

contraction_evaluations

Number of times the contraction used to compute prices or \(\delta\) was evaluated in each market. Counts are in the same order as Simulation.unique_market_ids.

Type

ndarray

Examples

Methods

compute_micro(micro_moments)

Compute averaged micro moment values, \(\bar{g}_M\).

to_dict([attributes])

Convert these results into a dictionary that maps attribute names to values.

to_problem([product_formulations, …])

Convert the solved simulation into a problem.