library(fio)
# Load the multi-regional world dataset
miom_world <- fiodata::world_2000
# Get bilateral trade from Brazil to China
miom_world$get_bilateral_trade("BRA", "CHN")[1:5, 1:2]
#> BRA_Agriculture, Hunting, Forestry and Fishing
#> CHN_Agriculture, Hunting, Forestry and Fishing 0.868486382
#> CHN_Mining and Quarrying 0.677175460
#> CHN_Food, Beverages and Tobacco 0.784219678
#> CHN_Textiles, leather and footwear 0.137408834
#> CHN_Pulp, paper, printing and publishing 0.003052195
#> BRA_Mining and Quarrying
#> CHN_Agriculture, Hunting, Forestry and Fishing 0.001110208
#> CHN_Mining and Quarrying 1.703217354
#> CHN_Food, Beverages and Tobacco 0.005707213
#> CHN_Textiles, leather and footwear 0.129627291
#> CHN_Pulp, paper, printing and publishing 0.015560710
# Compute regional interdependence
miom_world$get_regional_interdependence() |> head()
#> country self_reliance total_spillover_out total_spillover_in
#> 1 AUS 1.968515 0.3168527 0.006511634
#> 2 AUT 1.614535 0.4900724 0.004048698
#> 3 BEL 1.649908 0.7652207 0.011148228
#> 4 BRA 1.918948 0.2328115 0.004065824
#> 5 CAN 1.650380 0.4280919 0.007634451
#> 6 CHN 2.342241 0.2867934 0.016735715
#> interdependence_index
#> 1 0.1609602
#> 2 0.3035377
#> 3 0.4637960
#> 4 0.1213225
#> 5 0.2593898
#> 6 0.1224440We are thrilled to announce that {fio} 1.0.0 is now available on CRAN! This release marks a significant milestone in the package’s development, introducing powerful multi-regional capabilities, support for closed models, and a more streamlined data management strategy.
{fio} (Friendly Input-Output) was built with a clear goal: to provide R users with a fast and intuitive interface for input-output analysis. By leveraging Rust’s performance and R6 classes, {fio} allows you to handle complex linear algebra computations with ease and speed.
You can install it from CRAN with:
install.packages("fio")1 Multi-regional Input-Output (MIOM)
The headline feature of version 1.0.0 is the introduction of Multi-regional Input-Output (MIOM) models. This allows analysts to go beyond single economies and study the interdependencies between different nations or regions.
The new miom() class creates a multi-regional model that inherits all the performance and functionality of the single-region iom() class, adding specialized tools for regional analysis:
- Bilateral Trade: Easily extract trade flows between specific regions.
- Regional Multipliers: Compute intra-regional, inter-regional, and spillover multipliers.
- Interdependence Measures: Quantify how much regions rely on each other.
Here is a quick look at how you can analyze global trade interdependencies using the world_2000 dataset (now part of the {fiodata} package):
For a complete overview on miom class and its methods, check out the vignette: Multi-regional Input-Output Analysis.
2 Closing the Model
Input-output models are traditionally “open,” treating households and government as external to the production system. Version 1.0.0 introduces the close_model() method, which allows you to “internalize” these sectors.
By moving households or the government from final demand into the intermediate transactions matrix, you can better capture the “induced” effects of economic shocks—for instance, how an increase in production leads to higher wages, which in turn fuels more consumption.
iom_br <- fiodata::br_2020
# Close the model for household consumption
iom_br$close_model("household")
# Technical coefficients and multipliers now include the induced effects
iom_br$compute_tech_coeff()
iom_br$compute_leontief_inverse()
iom_br$compute_multiplier_output()3 Direct Data Access
To make it even easier to start your analysis, we’ve added download_wiod(). This function allows you to download World Input-Output Database (WIOD) tables directly from their official source and load them into R. Combined with {fio}’s processing speed, this significantly reduces the time from data collection to insight.
For a complete example on working with WIOD data, check out the vignette: Working with WIOD.
4 The {fiodata} Split
As the package grew, the built-in datasets reached a size that exceeded CRAN’s recommendations. To keep {fio} lightweight and fast to install, we have moved the datasets (br_2020 and world_2000) to a separate companion package: {fiodata}.
When you install {fio}, you might want to install {fiodata} as well to follow along with our examples:
# Install from CRAN
install.packages("fiodata")5 Acknowledgements
This release would not have been possible without the robust ecosystem of R and Rust packages. Special thanks to the developers of the extendr and faer projects, which provide the foundation for {fio}’s hybrid architecture.
For a full list of changes, please check the NEWS.md file. Happy analyzing!