calc_all stores the requested results in the database. Use resolve instead when you also want the returned matrix, or resolve_many for a mapping of results. The equations depend on the requested block, table kind and SUT technology assumption; see the block formulas.

import mario

db = mario.load_test("IOT")
db.calc_all(["f", "F"])
f = db.get_block_as_pandas("f")
F = db.get_block_as_pandas("F")

For this IOT example:

\[f=e(I-z)^{-1}, \qquad F=f\operatorname{diag}(Y\mathbf{1}).\]

F has the same account-by-production-node axes as f. Both matrices are reused if already stored; force_rewrite=True requests recomputation of the selected targets using the available dependencies.

CoreModel.calc_all(
matrices=['z', 'v', 'e', 'Z', 'V', 'E'],
scenario='baseline',
force_rewrite=False,
compute_options=None,
)#

Compute and materialize one or more matrices for a scenario.

Parameters:
  • matrices – One matrix name or an iterable of matrix names to materialize.

  • scenario – Scenario from which dependencies should be read and where the computed matrices should be stored.

  • force_rewrite – When True, recompute requested matrices even if they already exist in the scenario.

  • compute_options – Optional advanced compute options payload used to steer runtime planning and backend selection. When omitted, MARIO uses the globally configured compute defaults.

Returns:

The method materializes matrices in self.matrices.

Return type:

None

Notes

The runtime options above matter mainly for large IOT databases, where MARIO can compute the X total production vector, f total (direct+indirect) environmental transaction coefficients matrix, F total (direct+indirect) environmental transaction flows matrix, m total (direct+indirect) value added coefficients matrix, M total (direct+indirect) value added transaction matrix and p price index vector without materializing the full w Leontief inverse matrix.