# pyblp.ProblemResults.extract_diagonal_means¶

ProblemResults.extract_diagonal_means(matrices)

Extract means of diagonals from stacked $$J_t \times J_t$$ matrices for each market $$t$$.

Parameters

matrices (array-like) – Stacked matrices, such as estimates of $$\varepsilon$$, computed by ProblemResults.compute_elasticities(); $$\mathscr{D}$$, computed by ProblemResults.compute_diversion_ratios(); $$\bar{\mathscr{D}}$$, computed by ProblemResults.compute_long_run_diversion_ratios(); or $$s_{jti}$$ computed by ProblemResults.compute_probabilities().

Returns

Stacked diagonal means. If the matrices are estimates of $$\varepsilon$$, the mean of a diagonal is a market’s mean own elasticity of demand; if they are estimates of $$\mathscr{D}$$ or $$\bar{\mathscr{D}}$$, the mean of a diagonal is a market’s mean diversion ratio to the outside good. Rows are in the same order as Problem.unique_market_ids.

Return type

ndarray

Examples