Compute the Leontief inverse matrix from intermediate flows and total output. The Leontief inverse captures both direct and indirect requirements across the entire supply chain, enabling footprint tracing.
The technical coefficients matrix is computed as
\(A_{ij} = Z_{ij} / X_j\), representing the input of
sector \(i\) needed per unit of output from sector \(j\).
Column sums of A are capped below 1 using value_added_floor
(FABIO convention plus an explicit leakage floor) to ensure
\((I - A)\) is invertible even when supply-use data are
inconsistent. The Leontief inverse is then \(L = (I - A)^{-1}\).
For large systems (thousands of sectors) this function is not
usable: the dense L matrix requires \(n^2 \times 8\) bytes
of memory (e.g. ~4.8 GiB for n = 25 000). Use
compute_footprint() directly with z_mat and x_vec
instead, which solves \((I - A) x = Y\) without ever
materialising L.
Accepts both dense and sparse (Matrix package) inputs.
Arguments
- z_mat
Square numeric matrix of inter-industry flows. Entry \(Z_{ij}\) is the flow from sector \(i\) to sector \(j\). Can be dense or sparse.
- x_vec
Numeric vector of total output per sector. Must have the same length as
nrow(z_mat).- max_n
Maximum system size before aborting. Defaults to 5000. Set higher at your own risk of memory exhaustion.
- value_added_floor
Minimum share of each sector's output that is treated as non-intermediate leakage when constructing A. Column sums larger than
1 - value_added_floorare rescaled to that maximum. Use0to recover the previous cap-at-one behavior, though this can leave singular systems.
