Skip to contents

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
)

Arguments

supply_use

Tibble from build_supply_use(). By default, this function calls build_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 calls get_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 calls get_wide_cbs() internally. Must have columns: year, area_code, item_cbs_code, production, import, export, stock_withdrawal, stock_addition, plus final demand columns (food, other_uses).

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 TRUE and cbs contains a losses column, losses are moved from final demand to the diagonal of Z (self-use), following the FABIO convention. The losses column is removed from Y and fd_labels. Defaults to FALSE.

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 to area_code and item_cbs_code.

  • fd_labels: Tibble mapping each Y column to its area_code (consuming country) and fd_col (demand category, e.g. "food") . Pass to compute_footprint() as fd_labels to get a target_fd column 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 <dbl>, Z <list>, Y <list>, X <list>, labels <list>,
#> #   fd_labels <list>