Calculations#
These methods compute matrices, indicators and standalone IOT/SUT formula outputs. For normal database workflows, prefer the database compute API because it understands scenarios, table format and already materialized matrices.
For a compact spreadsheet overview of the nomenclature and worked matrix
calculations on the MARIO test IOT, SUT_IT and SUT_PT examples,
download the terminology workbook.
Database Compute API#
Method |
Use |
|---|---|
Materialize one or more requested matrices in a scenario. |
|
Resolve one matrix and return the materialized block. |
|
Resolve several matrices and return a mapping. |
|
Explain which compute path MARIO would use for one matrix. |
|
Calculate backward and forward linkage indicators. |
|
Build a greenhouse-gas aggregate extension from selected satellite rows. |
|
Aggregate one sector or commodity into a region-by-region trade matrix and optional heatmap. |
|
Calculate embodied trade content and, with |
|
Shortcut for |
|
Enumerate demand-driven structural paths for one indicator and final-demand bundle. |
|
Collapse embodied trade-content matrices into import accounts by destination Region. |
|
Collapse embodied trade-content matrices into export accounts by origin Region. |
|
Calculate embodied net imports as imports minus exports. |
|
Calculate contributor-region concentration of embodied trade content. |
|
Calculate embodied trade-content exposure to selected contributor Regions. |
- mario.CoreModel.calc_all
- mario.CoreModel.resolve
- mario.CoreModel.resolve_many
- mario.CoreModel.explain
- mario.Database.calc_linkages
- mario.Database.calc_ghg
- mario.Database.calc_trades
- mario.Database.calc_trades_content
- mario.Database.calc_trades_content_breakdown
- mario.Database.calc_spa
- mario.Database.calc_embodied_imports
- mario.Database.calc_embodied_exports
- mario.Database.calc_embodied_net_imports
- mario.Database.calc_trades_concentration
- mario.Database.calc_trades_exposure
- Resolvable Matrices and Blocks
Runtime Compute Options#
Demand-driven matrices such as the X total production vector, the f
total (direct+indirect) environmental transaction coefficients matrix, the
F total (direct+indirect) environmental transaction flows matrix, the m
total (direct+indirect) value added coefficients matrix, the M total
(direct+indirect) value added transaction matrix and the p price index
vector can be computed either through the explicit w Leontief inverse
matrix or through linear-system solves.
See mario.set_compute_method, mario.set_linear_solver and mario.set_linear_strategy.
Resolvable Database Blocks#
Many SUT and IOT results do not have dedicated Python methods. They are still
part of the public compute API through db.resolve(...), db.resolve_many(...),
db.calc_all(...) and dotted access such as db.Xa or db.wcc.
See Resolvable Matrices and Blocks for the authoritative list of built-in block names currently supported by MARIO.
Standalone IOT Helpers#
The functions below operate on pandas matrices directly. They do not mutate a
Database and they do not infer missing inputs. Matrix names and
descriptions follow the Matrices table in Nomenclature.
Function |
Calculation |
Formula |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Convert between |
|
|
Convert between |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Shares of the |
|
- mario.calc_X
- mario.calc_z
- mario.calc_Z
- mario.calc_w
- mario.calc_X_from_z
- mario.calc_X_from_w
- mario.calc_v
- mario.calc_V
- mario.calc_e
- mario.calc_E
- mario.calc_m
- mario.calc_m_from_z
- mario.calc_M
- mario.calc_f
- mario.calc_f_from_z
- mario.calc_F
- mario.calc_p
- mario.calc_p_from_z
- mario.calc_b
- mario.calc_g
- mario.calc_y
Standalone SUT Split Helpers#
The functions below operate on split SUT blocks directly. They are useful when
you already have activity-side and commodity-side blocks as pandas matrices and
want one standalone numerical helper instead of resolving through a
Database.
Function |
Calculation |
Formula |
|---|---|---|
|
Convert between |
|
|
Convert between |
|
|
Convert between |
|
|
Convert between |
|
|
Build activity-side value added multipliers and total activity-side value added footprints. |
|
|
Build commodity-side value added multipliers and total commodity-side value added footprints. |
|
|
Build activity-side environmental multipliers and total activity-side environmental footprints. |
|
|
Build commodity-side environmental multipliers and total commodity-side environmental footprints. |
|
Exploded Multiplier Matrices#
These methods decompose multiplier (f, m) matrices by stacking
one scaled transfer matrix per account/factor, yielding a (account, region,
sector) MultiIndex result. IOT and SUT use separate methods.
The _all property variants (e.g. db.f_ex_all) are zero-argument
shorthands that return the full matrix for all accounts/factors at baseline
scenario. Use the method form (e.g. db.f_ex(...)) to filter or select a
different scenario.
Method |
Property shorthand |
Table |
Formula |
|---|---|---|---|
IOT |
|
||
SUT |
|
||
SUT |
|
||
IOT |
|
||
SUT |
|
||
SUT |
|