mario.calc_s(S, Xc=None, *, Xa=None, tech_assumption=None)#

Calculate the SUT supply coefficients matrix s under IT or PT.

\[\begin{split}s = \begin{cases} S\operatorname{diag}(X_c)^{-1} & \text{IT},\\ \left(S^{\mathsf{T}}\operatorname{diag}(X_a)^{-1}\right)^{-1} & \text{PT}. \end{cases}\end{split}\]
Parameters:
  • S (pandas.DataFrame) – Supply flows, with activity rows and commodity columns.

  • Xc (pandas.DataFrame or pandas.Series, optional) – Commodity production, required under IT and unused under PT. Its index must match the columns of S. A DataFrame must have one column.

  • Xa (pandas.DataFrame or pandas.Series, optional) – Activity production, required under PT and unused under IT. Its index must match the rows of S. A DataFrame must have one column.

  • tech_assumption ({"industry-based", "product-based", "IT", "PT"}, optional) – Technology assumption; defaults to industry-based (IT).

Returns:

Supply coefficients, with the activity rows and commodity columns of S.

Return type:

pandas.DataFrame

Notes

IT supports rectangular supply tables and treats inverse zero production as zero. PT requires a square supply table and Xa; a missing Xa raises ValueError. The PT matrix inverse falls back to the Moore-Penrose pseudo-inverse for a singular product-mix matrix.

Examples

import mario

s_it = mario.calc_s(S, Xc)
s_pt = mario.calc_s(S, Xa=Xa, tech_assumption="PT")