In this vignette we explain how the Bilateral Trade Assumption can be formulated from a .tidy_iea_df.

The Bilateral Trade Assumption

The Bilateral Trade Assumption (BTA) enables the analyst to construct the Multi-Regional Physical Supply Use Table (MR-PSUT) framework by providing bilateral trade data linking regions. An excellent example of MR-PSUT constructed following a BTA for agricultural products can be found in Bruckner et al. (2019).

The BTA is therefore the assumption closest to reality, as it seeks to describe each bilateral energy carrier flow from one country to another. The only drawback is that it requires input data representing bilateral flows between countries or regions, which may be hard to find, or which may require significant data preparation time.

Formulating the Bilateral Trade Assumption

To formulate the BTA, one needs to:

  • Prepare bilateral trade data
  • Call the IEATools::add_psut_matnames') to add a matrix name column.
  • Call the convert_to_net_trade(), which converts trade data to net trade. See “Possible issues” below.
  • Call the transform_to_bta() function, and provide bilateral trade data as argument to the function.

Preparing bilateral trade data

The bilateral trade data needs to be provided as input to the transform_to_bta() function in the following format:

AB_world_btd <- tidy_AB_data %>% 
  IEATools::add_psut_matnames() %>% 
  calc_bilateral_trade_df_gma() %>% 
  dplyr::glimpse()
## Rows: 8
## Columns: 8
## $ Provenience              <chr> "A", "A", "A", "A", "A", "A", "B", "B"
## $ Country                  <chr> "A", "B", "A", "B", "A", "B", "A", "B"
## $ Method                   <chr> "PCM", "PCM", "PCM", "PCM", "PCM", "PCM", "PC…
## $ Energy.type              <chr> "E", "E", "E", "E", "E", "E", "E", "E"
## $ Last.stage               <chr> "Final", "Final", "Final", "Final", "Final", …
## $ Year                     <dbl> 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018
## $ Product                  <chr> "Coking coal", "Coking coal", "Crude oil", "C…
## $ Share_Exports_By_Product <dbl> 0, 1, 0, 1, 0, 1, 1, 0

Here we have used the calc_bilateral_trade_df_gma() function to pull the share of exports that would correspond to the Global Market Assumption, but the analyst can proceed in any way to turn the bilateral trade data in a data frame of the dimensions and features shown above.

Next step is to verify that the constructed bilateral trade data frame is valid. To check that the bilateral trade data that has been prepared is valid, one can use the check_bilateral_trade_df() function. To be valid, both (1)~the sum of shares by product and by exporting country (“Provenience” column) should be equal to unity; and (2)~the sum of shares by product and by importing country (“Country” column) should be equal to unity.

For instance, the bilateral trade data that we have obtained using the calc_bilateral_trade_df_gma() function is valid:

## [1] TRUE

Conversely, if we filter out the second row, the bilateral trade data is not valid anymore:

AB_world_btd %>% 
  dplyr::filter(! (Product == "Coking coal" & Share_Exports_By_Product == 1)) %>% 
  check_bilateral_trade_df()
## Error: The sum of shares by product and exporting country is not equal to 1.

Note: It is important to note that one doesn’t need to provide the bilateral trade data for all products. If some products are not covered in the bilateral trade data, then the Global Market Assumption will be used to do the trade linking process for missing products. But it is important that the products that are covered are fully covered (i.e. that all flows corresponding to all the regions included in the MR-PSUT are included in the bilateral trade data frame, for that given product).

Transforming to Bilateral Trade Assumption

Once the bilateral trade data is prepared, and once it has been verified with the check_bilateral_trade_df() function that the bilateral trade data is valid, one can call the transform_to_bta() function as follows:

tidy_AB_data %>% 
  tibble::add_row(Country = "B", Method = "PCM", Energy.type = "E", Last.stage = "Final", Year = 2018, 
                  Ledger.side = "Supply", Flow.aggregation.point = "Total primary energy supply", 
                  Flow = "Imports [of A very odd product]", Product = "A very odd product", Unit = "ktoe", E.dot = 100) %>% 
  IEATools::add_psut_matnames() %>% 
  convert_to_net_trade() %>% 
  transform_to_bta(bilateral_trade_df = AB_world_btd) %>% 
  dplyr::glimpse()
## Rows: 102
## Columns: 12
## $ Country                <chr> "World", "World", "World", "World", "World", "W…
## $ Method                 <chr> "PCM", "PCM", "PCM", "PCM", "PCM", "PCM", "PCM"…
## $ Energy.type            <chr> "E", "E", "E", "E", "E", "E", "E", "E", "E", "E…
## $ Last.stage             <chr> "Final", "Final", "Final", "Final", "Final", "F…
## $ Year                   <dbl> 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018,…
## $ Ledger.side            <chr> "Supply", "Supply", "Supply", "Supply", "Supply…
## $ Flow.aggregation.point <chr> "Total primary energy supply", "Total primary e…
## $ Flow                   <chr> "{A}_Resources [of Coking coal]", "{A}_Resource…
## $ Product                <chr> "{A}_Coking coal [from Resources]", "{A}_Crude …
## $ Unit                   <chr> "ktoe", "ktoe", "ktoe", "ktoe", "ktoe", "ktoe",…
## $ E.dot                  <dbl> 5000, 8500, 4000, 600, 2000, 3000, 2500, 100, 8…
## $ matnames               <chr> "R", "R", "R", "R", "R", "R", "R", "R", "V", "V…

Regarding the treatment of unbalances and potential issues that may appear while formulating the Bilateral Trade Assumption, it is recommended to read first the Global Market Assumption vignette.

References

Bruckner, Martin, Richard Wood, Daniel Moran, Nikolas Kuschnig, Hanspeter Wieland, Victor Maus, and Jan Börner. 2019. FABIOThe Construction of the Food and Agriculture Biomass InputOutput Model.” Environmental Science & Technology 53 (19): 11302–12. https://doi.org/10.1021/acs.est.9b03554.