# pyblp.ProblemResults.compute_probabilities¶

ProblemResults.compute_probabilities(market_id=None)

Estimate matrices of choice probabilities.

For each market, the value in row $$j$$ and column i is given by (5) when there are random coefficients, and by (37) when there is additionally a nested structure. For the logit and nested logit models, choice probabilities are market shares.

Parameters

market_id (object, optional) – ID of the market in which to compute choice probabilities. By default, choice probabilities are computed in all markets and stacked.

Returns

Estimated $$J_t \times I_t$$ matrices of choice probabilities. If market_id was not specified, matrices are estimated in each market $$t$$ and stacked. Columns for a market are in the same order as agents for the market. If a market has fewer agents than others, extra columns will contain numpy.nan.

Return type

ndarray

Examples