Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convergence target wrong in target_sda(by_company = TRUE) #445

Closed
jacobvjk opened this issue Sep 1, 2023 · 1 comment · Fixed by #446
Closed

Convergence target wrong in target_sda(by_company = TRUE) #445

jacobvjk opened this issue Sep 1, 2023 · 1 comment · Fixed by #446
Assignees
Labels
bug an unexpected problem or unintended behavior

Comments

@jacobvjk
Copy link
Member

jacobvjk commented Sep 1, 2023

When running the Sectoral Decarbonization Approach on the loan book level (target_sda(by_company = FALSE)), the emission intensity of the final year of the adjusted scenario is used as the value at which the loan book EI needs to converge. The scenario targets for the loan book therefore approach that EI of the final year, as expected and described in the PACTA for Banks methodology.

However, when running the same function at the company level (target_sda(by_company = TRUE)) this is not the case. The current implementation drops the adjusted scenario values after the final year for which company EIs are available before calculating the companies' scenario targets. This means that the final scenario value available when calculating the EI targets is now from a year much closer to the beginning of the analysis and of the final year of the input scenario. In effect, the targets for companies will converge on the adjusted scenario value of the last available ABCD year (usually t5) instead of the final scenario year (usually 2050). This leads to inconsistent calculations between the loan book and the company levels. The implementation used on the loan book level needs to be followed on the company level, too.

library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(r2dii.analysis)
library(r2dii.data)

matched <- tibble::tribble(
  ~id_loan, ~loan_size_outstanding, ~loan_size_outstanding_currency, ~loan_size_credit_limit, ~loan_size_credit_limit_currency, ~id_2dii,            ~level, ~score,     ~name_abcd, ~sector_abcd,
    "L162",                      1,                           "EUR",                       2,                            "EUR",    "UP1", "ultimate_parent",      1, "shaanxi auto",     "cement"
)

abcd <- tibble::tribble(
   ~name_company,  ~sector, ~technology, ~year, ~production, ~emission_factor, ~plant_location, ~is_ultimate_owner,
  "shaanxi auto", "cement",    "cement",  2020,           1,                1,            "BF",               TRUE,
  "shaanxi auto", "cement",    "cement",  2021,           1,                2,            "BF",               TRUE,
  "shaanxi auto", "cement",    "cement",  2022,           1,                3,            "BF",               TRUE
)

co2_intensity_scenario <- tibble::tribble(
  ~scenario,  ~sector,  ~region, ~year, ~emission_factor,           ~emission_factor_unit, ~scenario_source,
     "b2ds", "cement", "global",  2020,              0.6, "tons of CO2 per ton of cement",      "demo_2020",
     "b2ds", "cement", "global",  2050,              0.2, "tons of CO2 per ton of cement",      "demo_2020"
)

region_isos <- r2dii.data::region_isos_demo %>%
  dplyr::filter(.data$region == "global")

out <- target_sda(
  matched,
  abcd = abcd,
  co2_intensity_scenario = co2_intensity_scenario,
  region_isos = region_isos
)

out_company <- target_sda(
  matched,
  abcd = abcd,
  co2_intensity_scenario = co2_intensity_scenario,
  by_company = TRUE,
  region_isos = region_isos
)

# given that the ABCD in this example consists of one company, we expect that the emission intensity targets for the benchmark must be equal to the targets for the loan book and for the single company

# check expectation on loan book level
benchmark_loanbook_scenario <- out %>%
  dplyr::filter(.data$emission_factor_metric == "adjusted_scenario_b2ds") %>%
  dplyr::arrange(.data$year) %>%
  dplyr::pull()

loanbook_scenario <- out %>%
  dplyr::filter(.data$emission_factor_metric == "target_b2ds") %>%
  dplyr::arrange(.data$year) %>%
  dplyr::pull()

setequal(benchmark_loanbook_scenario, loanbook_scenario)
#> [1] TRUE

# check expectation on company level
benchmark_company_scenario <- out_company %>%
  dplyr::filter(.data$emission_factor_metric == "adjusted_scenario_b2ds") %>%
  dplyr::arrange(.data$year) %>%
  dplyr::pull()

company_scenario <- out_company %>%
  dplyr::filter(.data$emission_factor_metric == "target_b2ds") %>%
  dplyr::arrange(.data$year) %>%
  dplyr::pull()

setequal(benchmark_company_scenario, company_scenario)
#> [1] FALSE

# check if loan book and company level targets line up
setequal(loanbook_scenario, company_scenario)
#> [1] FALSE

# we can see that the latter two assumptions do not hold
# the company level scenario is set only for the years of the projection based on the convergence value of that period instead of the final value of the scenario
out %>%
  dplyr::filter(
    .data$emission_factor_metric %in% c("adjusted_scenario_b2ds", "target_b2ds"),
    .data$year <= 2022
  ) %>%
  dplyr::select(
    dplyr::all_of(c("year", "scenario_source", "emission_factor_metric", "emission_factor_value"))
  )
#> # A tibble: 6 × 4
#>    year scenario_source emission_factor_metric emission_factor_value
#>   <dbl> <chr>           <chr>                                  <dbl>
#> 1  2020 demo_2020       target_b2ds                            1    
#> 2  2021 demo_2020       target_b2ds                            0.978
#> 3  2022 demo_2020       target_b2ds                            0.956
#> 4  2020 demo_2020       adjusted_scenario_b2ds                 1    
#> 5  2021 demo_2020       adjusted_scenario_b2ds                 0.978
#> 6  2022 demo_2020       adjusted_scenario_b2ds                 0.956

# note how the target_b2ds values decrease more slowly in the cas of company level calculation, although based on the exact same data
out_company %>%
  dplyr::filter(
    .data$emission_factor_metric %in% c("adjusted_scenario_b2ds", "target_b2ds"),
    .data$year <= 2022
  ) %>%
  dplyr::select(
    dplyr::all_of(c("year", "scenario_source", "name_abcd", "emission_factor_metric", "emission_factor_value"))
  )
#> # A tibble: 6 × 5
#>    year scenario_source name_abcd   emission_factor_metric emission_factor_value
#>   <dbl> <chr>           <chr>       <chr>                                  <dbl>
#> 1  2020 demo_2020       shaanxi au… target_b2ds                            1    
#> 2  2021 demo_2020       shaanxi au… target_b2ds                            0.999
#> 3  2022 demo_2020       shaanxi au… target_b2ds                            0.997
#> 4  2020 demo_2020       market      adjusted_scenario_b2ds                 1    
#> 5  2021 demo_2020       market      adjusted_scenario_b2ds                 0.978
#> 6  2022 demo_2020       market      adjusted_scenario_b2ds                 0.956

Created on 2023-09-01 with reprex v2.0.2

@jacobvjk jacobvjk added the bug an unexpected problem or unintended behavior label Sep 1, 2023
@jacobvjk jacobvjk self-assigned this Sep 1, 2023
@jacobvjk
Copy link
Member Author

jacobvjk commented Sep 1, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant