# pyblp.ProblemResults.extract_diagonals¶

ProblemResults.extract_diagonals(matrices)

Extract 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 matrix diagonals. If the matrices are estimates of $$\varepsilon$$, a diagonal is a market’s own elasticities of demand; if they are estimates of $$\mathscr{D}$$ or $$\bar{\mathscr{D}}$$, a diagonal is a market’s diversion ratios to the outside good.

Return type

ndarray

Examples