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

SDA Convergence target differs depending on time-horizon of ald #234

Closed
jdhoffa opened this issue Nov 30, 2020 · 2 comments · Fixed by #241
Closed

SDA Convergence target differs depending on time-horizon of ald #234

jdhoffa opened this issue Nov 30, 2020 · 2 comments · Fixed by #241
Labels
bug an unexpected problem or unintended behavior

Comments

@jdhoffa
Copy link
Member

jdhoffa commented Nov 30, 2020

The SDA target is calculated by setting the portfolio average value on a trajectory that converges to the adjusted scenario value, at year 2050. (see here: https://2degreesinvesting.github.io/r2dii.analysis/articles/target-sda.html)

After a conversation with a bank, I noticed some weird behaviour when the target was telling them to increase their emissions, when the target should have decreased. After exploring a bit, it seems that the target calculated is different, depending on the ald file. In particular, if the ald has data until 2050, then the target is calculated correctly. However, if the ald only has data for a few years into the future, then the target attempts to converge to an earlier year, and if the corporate economy target is greater than the portfolio, it will push it to increase their emissions.

@2diiKlaus I would appreciate if you could confirm that this doesn't make sense. I think this is a pretty big bug.

See the reprex below:

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(ggplot2)
library(r2dii.analysis)

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, ~sector,   ~name_ald, ~sector_ald,
  "L1",                      1,                           "EUR",                       2,                            "EUR",    "UP1", "ultimate_parent",      1, "steel", "company a",     "steel"
)

ald <- tibble::tribble(
  ~name_company, ~sector, ~technology, ~year, ~production, ~emission_factor, ~plant_location, ~is_ultimate_owner,
  "company a", "steel",     "steel",  2020,           1,           1.5,            "DE",               TRUE,
  "company a", "steel",     "steel",  2025,           1,           1.5,            "DE",               TRUE,
  "company a", "steel",     "steel",  2030,           1,           1.5,            "DE",               TRUE,
  "company b", "steel",     "steel",  2020,           1,           2.5,            "DE",               TRUE,
  "company b", "steel",     "steel",  2025,           1,           2.5,            "DE",               TRUE,
  "company b", "steel",     "steel",  2030,           1,           2.5,            "DE",               TRUE
)

co2_scenario <- tibble::tribble(
  ~scenario_source, ~scenario, ~sector,  ~region, ~year, ~emission_factor,              ~emission_factor_unit,
  "etp_2017",    "b2ds", "steel", "global",  2020, 2, "tonnes of CO2 per tonne of steel",
  "etp_2017",    "b2ds", "steel", "global",  2025, 1.9, "tonnes of CO2 per tonne of steel",
  "etp_2017",    "b2ds", "steel", "global",  2030, 1.8, "tonnes of CO2 per tonne of steel",
  "etp_2017",    "b2ds", "steel", "global",  2050,      0.25, "tonnes of CO2 per tonne of steel",
)

out1 <- target_sda(matched, ald, co2_scenario)

ggplot(
  data = out1, 
  mapping = aes(
    x = year, 
    y = emission_factor_value, 
    color = emission_factor_metric)
) +
  geom_line() +
  facet_wrap(~ sector)

ald2 <- tibble::tribble(
  ~name_company, ~sector, ~technology, ~year, ~production, ~emission_factor, ~plant_location, ~is_ultimate_owner,
  "company a", "steel",     "steel",  2020,           1,           1.5,            "DE",               TRUE,
  "company a", "steel",     "steel",  2025,           1,           1.5,            "DE",               TRUE,
  "company a", "steel",     "steel",  2030,           1,           1.5,            "DE",               TRUE,
  "company a", "steel",     "steel",  2050,           1,           1.5,            "DE",               TRUE, # add a value for year = 2050
  "company b", "steel",     "steel",  2020,           1,           2.5,            "DE",               TRUE,
  "company b", "steel",     "steel",  2025,           1,           2.5,            "DE",               TRUE,
  "company b", "steel",     "steel",  2030,           1,           2.5,            "DE",               TRUE
)

out2 <- target_sda(matched, ald2, co2_scenario)

ggplot(
  data = out2, 
  mapping = aes(
    x = year, 
    y = emission_factor_value, 
    color = emission_factor_metric)
) +
  geom_line() +
  facet_wrap(~ sector)

Created on 2020-11-30 by the reprex package (v0.3.0)

@2diiKlaus
Copy link

@jdhoffa yes that does not make sense indeed. So happy for you to adjust the function

@jdhoffa
Copy link
Member Author

jdhoffa commented Dec 2, 2020

danke

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.

2 participants