Mathematical background

This section gives a general overview about the mathematical background of Input-Output calculations. For a full detail account of this matter please see Miller and Blair 2009

Generally, mathematical routines implemented in pymrio follow the equations described below. If, however, a more efficient mechanism was available this was preferred. This was generally the case when numpy broadcasting was available for a specific operation, resulting in a substantial speed up of the calculations. In these cases the original formula remains as comment in the source code.

When both operands have pandas labels, the mathematical routines align their corresponding rows or columns before calculation. Matching labels may appear in different orders, but missing, extra, or duplicate labels raise a ValueError where an alignment would otherwise be ambiguous. NumPy inputs have no labels and are matched by position, so their ordering must be consistent.

Basic MRIO calculations

MRIO tables describe the global inter-industries flows within and across countries for \(k\) countries with a transaction matrix \(Z\):

\[\begin{split}\begin{equation} Z = \begin{pmatrix} Z_{1,1} & Z_{1,2} & \cdots & Z_{1,k} \\ Z_{2,1} & Z_{2,2} & \cdots & Z_{2,k} \\ \vdots & \vdots & \ddots & \vdots \\ Z_{k,1} & Z_{k,2} & \cdots & Z_{k,k} \end{pmatrix} \end{equation}\end{split}\]

Each submatrix on the main diagonal (\(Z_{i,i}\)) represents the domestic interactions for each industry \(n\). The off diagonal matrices (\(Z_{i,j}\)) describe the trade from region \(i\) to region \(j\) (with \(i, j = 1, \ldots, k\)) for each industry. Accordingly, global final demand can be represented by

\[\begin{split}\begin{equation} Y = \begin{pmatrix} Y_{1,1} & Y_{1,2} & \cdots & Y_{1,k} \\ Y_{2,1} & Y_{2,2} & \cdots & Y_{2,k} \\ \vdots & \vdots & \ddots & \vdots \\ Y_{k,1} & Y_{k,2} & \cdots & Y_{k,k} \end{pmatrix} \end{equation}\end{split}\]

with final demand satisfied by domestic production in the main diagonal (\(Y_{i,i}\)) and direct import to final demand from country \(i\) to \(j\) by \(Y_{i,j}\).

The global economy can thus be described by:

\[\begin{equation} x = Ze + Ye \end{equation}\]

with \(e\) representing the summation vector (column vector with 1’s of appropriate dimension) and \(x\) the total industry output.

The direct requirement matrix \(A\) is given by multiplication of \(Z\) with the diagonalised and inverted industry output \(x\):

\[\begin{equation} A = Z\hat{x}^{-1} \end{equation}\]

Based on the linear economy assumption of the IO model and the classic Leontief demand-style modeling (see Leontief 1970), total industry output \(x\) can be calculated for any arbitrary vector of final demand \(y\) by multiplying with the total requirement matrix (Leontief matrix) \(L\).

\[\begin{equation} x = (\mathrm{I}- A)^{-1}y = Ly \end{equation}\]

with \(\mathrm{I}\) defined as the identity matrix with the size of \(A\).

The global multi regional IO system can be extended with various factors of production \(f_{h,i}\). These can represent among others value added, employment and social factors (\(h\), with \(h = 1, \ldots, r\)) per country. The row vectors of factors can be summarised in a factor of production matrix \(F\):

\[\begin{split}\begin{equation} F = \begin{pmatrix} f_{1,1} & f_{1,2} & \cdots & f_{1,k} \\ f_{2,1} & f_{2,2} & \cdots & f_{2,k} \\ \vdots & \vdots & \ddots & \vdots \\ f_{r,1} & f_{r,2} & \cdots & f_{r,k} \end{pmatrix} \end{equation}\end{split}\]

with the factor of production coefficients \(S\) given by

\[\begin{equation} S = F\hat{x}^{-1} \end{equation}\]

Multipliers (total, direct and indirect, requirement factors for one unit of output) are then obtained by

\[\begin{equation} M = SL \end{equation}\]

Total requirements (footprints in case of environmental requirements) for any given final demand vector \(y\) are then given by

\[\begin{equation} D_{cba} = My \end{equation}\]

To attribute impacts to individual demanded sectors, pymrio.calc_accounts() first aggregates final-demand categories to one column per consuming country. It then disaggregates each column by sector into \(\widetilde{Y}\): each resulting column contains the demand for one sector in one consuming country. The output required throughout the supply chain is

\[X = L\widetilde{Y}.\]

The block \(X_{i,j}\) contains production in country \(i\) required by final demand in country \(j\). Setting the domestic blocks of this output requirements matrix to zero isolates production abroad:

\[\begin{split}(X_t)_{i,j} = \begin{cases} 0 & \text{if } i = j, \\ X_{i,j} & \text{otherwise}. \end{cases}\end{split}\]

The impacts embodied in imports are then

\[\begin{equation} D_{imp} = SX_t \end{equation}\]

Each column of \(D_{imp}\) refers to the consuming country and its demanded sector. The impacts occurring in each producing sector to satisfy final demand in other countries are

\[\begin{equation} D_{exp} = S\widehat{X_t e} \end{equation}\]

where \(e\) sums across consuming countries and demanded sectors, and the hat diagonalizes the resulting output vector. Each column of \(D_{exp}\) refers to the producing country and sector.

For example, suppose country 1 consumes 100 units of its own product, each unit requiring 0.5 units of input from country 2. At direct impact intensities of 1 and 2 in countries 1 and 2 respectively, the imported inputs embody 100 units of impact. These are country 1’s import impacts and country 2’s export impacts. The purchased final product is domestic, so removing domestic final demand before applying \(L\) would incorrectly omit these impacts.

If the factor of production represent required environmental impacts, these can also occur during the final use phase. In that case \(F_Y\) describe the impacts associated with final demand (e.g. household emissions).

These need to be added to the total production- and consumption-based accounts to obtain the total impacts per country. Production-based accounts (direct territorial requirements) per region i are therefore given by summing over the stressors per sector (0 … m) plus the stressors occurring due to the final consumption for all final demand categories (0 … w) of that region.

\[\begin{equation} D_{pba}^i = \sum_{s=0}^m F^i_s + \sum_{c=0}^w F^i_{Yc} \end{equation}\]

Similarly, total requirements (footprints in case of environmental requirements) per region i are given by summing the detailed footprint accounts and adding the aggregated final demand stressors.

\[\begin{equation} D_{cba}^i = \sum_{s=0}^m D_{cba, s}^{i} + \sum_{c=0}^w F_{Yc}^i \end{equation}\]

Internally, the summation are implemented with the group-by functionality provided by the pandas package.

Upstream and Downstream scope 3

In the context of impact analyses the factors of production are often categorized into scope 1, 2 and 3, with scope 3 sub-divided into upstream and downstream.

For a MRIO the scope 1 is the direct impact of the industries. The factors of production scope 1 associated with some product or service in sector ‘i’ of monetary value ‘r’ is given by \(S e_i r\), where \(e_i\) is the math:i^{th}` unit vector. Scope 2 is the indirect impact through directly consumed energy (mostly electricity). The precise definition of scope 2 in an MRIO depends on the list of MRIO sectors that are classified as scope 2 energy suppliers. Scope 2 is therefore included in the upstream scope 3, which we refer to as upstream indirect impacts. The upstream multipliers are

\[\begin{equation} M_{up} = S ( L - I ) = M - S. \end{equation}\]

The downstream scope 3 consists of the factors of production associated with the sectors’ output that is input to other sectors. The downstream impact can be attributed with the Ghosh methodology (Lenzen, 2010 ).

The downstream attribution according to Ghosh is done by the input share matrix

\[\begin{equation} B = \hat{x}^{-1} Z \end{equation}\]

Note that we have defined this matrix in analogy with \(A\), meaning that the factors of production coefficient are given by \(S G^{T}\) where

\[\begin{equation} G = (\mathrm{I}- B)^{-1} = \hat{x}^{-1} L \hat{x} \end{equation}\]

is the Ghosh inverse matrix. The pure downstream multiplier (excluding scope 1) is given by

\[\begin{equation} M_{down} = S(G^{T}-I) \end{equation}\]

The sector’s total impact multiplier is simply the sum of \(M_{up}\), \(S\) and \(M_{down}\).

Aggregation

For the aggregation of the MRIO system the matrix \(B_k\) defines the aggregation matrix for regions and \(B_n\) the aggregation matrix for sectors.

\[\begin{split}\begin{equation} B_k = \begin{pmatrix} b_{1,1} & b_{1,2} & \cdots & b_{1,k} \\ b_{2,1} & b_{2,2} & \cdots & b_{2,k} \\ \vdots & \vdots & \ddots & \vdots \\ b_{w,1} & b_{w,2} & \cdots & b_{w,k} \end{pmatrix} B_n = \begin{pmatrix} b_{1,1} & b_{1,2} & \cdots & b_{1,n} \\ b_{2,1} & b_{2,2} & \cdots & b_{2,n} \\ \vdots & \vdots & \ddots & \vdots \\ b_{x,1} & b_{x,2} & \cdots & b_{x,n} \end{pmatrix} \end{equation}\end{split}\]

With \(w\) and \(x\) defining the aggregated number of countries and sectors, respectively. Entries \(b\) are set to 1 if the sector/country of the column belong to the aggregated sector/region in the corresponding row and zero otherwise. The complete aggregation matrix \(B\) is given by the Kronecker product \(\otimes\) of \(B_k\) and \(B_n\):

\[\begin{equation} B = B_k \otimes B_n \end{equation}\]

This effectively arranges the sector aggregation matrix \(B_n\) as defined by the region aggregation matrix \(B_k\). Thus, for each 0 entry in \(B_k\) a block \(B_n * 0\) is inserted in \(B\) and each 1 corresponds to \(B_n * 1\) in \(B\).

The aggregated IO system can then be obtained by

\[\begin{equation} Z_{agg} = BZB^\mathrm{T} \end{equation}\]

and

\[\begin{equation} Y_{agg} = BY(B_k \otimes \mathrm{I})^\mathrm{T} \end{equation}\]

with \(\mathrm{I}\) defined as the identity matrix with the size equal to the number of final demand categories per country.

Factors of production are aggregated by

\[\begin{equation} F_{agg} = FB^\mathrm{T} \end{equation}\]

and final demand impacts by

\[\begin{equation} F_{Y, agg} = F_Y(B_k \otimes \mathrm{I})^\mathrm{T} \end{equation}\]