Construct a multi-regional input-output (MRIO) model from supply-use tables, bilateral trade, and commodity balance sheets. Uses the industry technology assumption to derive symmetric product-by-product tables.
The resulting matrices follow the FABIO methodology
(Bruckner et al., 2019). Rows and columns of Z represent
(country, item) pairs. Each entry Z[i,j] gives the
intermediate flow from sector i to sector j.
Usage
build_io_model(
supply_use = NULL,
bilateral_trade = NULL,
cbs = NULL,
years = NULL,
endogenize_losses = FALSE,
method = c("mass", "value"),
prices = NULL,
trade_recovery = .cbs_trade_recovery_choices()
)Arguments
- supply_use
Tibble from
build_supply_use(). By default, this function callsbuild_supply_use()internally. Must have columns:year,area_code,proc_group,proc_cbs_code,item_cbs_code,type,value.- bilateral_trade
Tibble from
get_bilateral_trade(). By default, this function callsget_bilateral_trade()internally. Must have columns:year,item_cbs_code,bilateral_trade(list-column of matrices).- cbs
Tibble from
get_wide_cbs(). By default, this function callsget_wide_cbs()internally. Must have columns:year,area_code,item_cbs_code,production,export,stock_withdrawal,stock_addition, plus final demand columns (food,other_uses).importis read only whenbilateral_tradeisNULL, byget_bilateral_trade(), which balances the trade matrices against it.year,area_codeanditem_cbs_codemust hold noNA, here and insupply_use: a row with a missing code cannot be placed in the model.- years
Numeric vector of years to compute, or NULL. If NULL, computes all years in the intersection of available data across inputs. If specified, must be a subset of available years.
- endogenize_losses
Logical. If
TRUEandcbscontains alossescolumn, losses are moved from final demand to the diagonal ofZ(self-use), following the FABIO convention. Thelossescolumn is removed from Y andfd_labels.get_wide_cbs()emits nolossescolumn, soTRUEwith such acbswarns and builds the same model asFALSE. Defaults toFALSE.- method
Co-product allocation method.
"mass"(default) splits a multi-output process's inputs across its products by physical mass;"value"splits them by economic value (mass times export price), so high-value co-products (e.g. oil over cake, meat over hides) carry a larger share of upstream pressures. A process whose co-products lack usable prices falls back to mass.- prices
Optional tibble of item prices as from
build_cbs_prices()(year,element,item_cbs_code,price). Used only whenmethod = "value"; built automatically whenNULL.- trade_recovery
One of
"byproduct_residual"(default),"pass_through","net_import"or"none", selecting the CBS every internally built input is derived from — the wide CBS, the processing coefficients, the supply-use tables, the bilateral trade matrices and the prices. Seebuild_commodity_balances()for what each method does. It has no effect on an input supplied directly, so acbsbuilt with one method and the rest left to build under another is the caller's to avoid; pass the same value everywhere.
Value
A tibble with one row per year and list-columns:
Z: Inter-industry flow matrix (product-by-product).Y: Final demand matrix.X: Total output vector.labels: Tibble mapping row/column indices toarea_code,item_cbs_code, and reporting polity metadata.fd_labels: Tibble mapping each Y column to itsarea_code(consuming polity),fd_col(demand category, e.g."food"), and reporting polity metadata. Pass tocompute_footprint()asfd_labelsto get atarget_fdcolumn in the footprint output.
Examples
su <- build_supply_use(example = TRUE)
btd <- get_bilateral_trade(example = TRUE)
cbs <- get_wide_cbs(example = TRUE)
build_io_model(su, btd, cbs)
#> Warning: no non-missing arguments to min; returning Inf
#> Warning: no non-missing arguments to max; returning -Inf
#> ℹ Building IO model for 0 years.
#> Year range: Inf--Inf.
#> Final demand columns: food, other_uses, and stock_addition.
#> ✔ IO model complete.
#> # A tibble: 0 × 6
#> # ℹ 6 variables: year <int>, Z <list>, Y <list>, X <list>, labels <list>,
#> # fd_labels <list>
