All functions

asset_value_at_risk()

Calculate percentage value change between scenarios for equity (and temporarily other asset types) on the portfolio level

calc_late_sudden_traj()

Calculate how the production trajectory for a company/ald_business_unit changes after the policy shock hits.

calc_scenario_prices()

Calculate scenario prices

calc_survival_probability_merton()

Calculate survival probability

calculate_annual_profits()

Calculate annual profits

calculate_lrisk_trajectory()

Calculate litigation shock trajectory

calculate_net_profits()

Calculates annual net profits on the company-ald_business_unit level for the baseline and late and sudden scenarios. Climate laggards which need to build out their production in increasing technologies to compensate for their missed targets, are "punished" by adjusting the net profit margin on their additional build out based on their proximity to target within the given ald_business_unit. Specifically, we measure the ratio of how much of the required build out or reduction in a ald_business_unit the company will have done at the end of the forecast period. If the ald_business_unit has an increasing target and the ratio of completion is below one, the net_profit_margin on the additional production build out is multiplied with the proximity to the target. This approximates the additional capital investment such a company would have to make in a short time, which leads to added costs. This ensures that late build out will not proportionally translate into increased profits.

calculate_net_profits_baseline()

Calculates annual net profits on the company-ald_business_unit level for the baseline scenario

calculate_net_profits_shock_declining_technologies()

Calculates annual net profits on the company-ald_business_unit level for the shock scenario for declining technologies

calculate_net_profits_shock_declining_technologies_carbon_tax()

Calculates annual net profits on the company-ald_business_unit level for the baseline and late and sudden scenarios - with a carbon tax being added.

calculate_net_profits_shock_increasing_technologies()

Calculates annual net profits on the company-ald_business_unit level for the shock scenario for increasing technologies. Climate laggards which need to build out their production in increasing technologies to compensate for their missed targets, are "punished" by adjusting the net profit margin on their additional build out based on their proximity to target within the given ald_business_unit. Specifically, we measure the ratio of how much of the required build out or reduction in a ald_business_unit the company will have done at the end of the forecast period. If the ald_business_unit has an increasing target and the ratio of completion is below one, the net_profit_margin on the additional production build out is multiplied with the proximity to the target. This approximates the additional capital investment such a company would have to make in a short time, which leads to added costs. This ensures that late build out will not proportionally translate into increased profits.

calculate_net_profits_without_carbon_tax()

Calculates annual net profits on the company-ald_business_unit level for the baseline and late and sudden scenarios - without a carbon tax being added.

calculate_pd_change_overall()

Calculate change in probabilities of default (PDs) of loans connected to companies at hand. This is based on the equity values derived from the DCF model. Said Equity values are used as different starting points for the Merton model (one reflecting the business as usual baseline scenario, the other reflecting the late & sudden shock scenario). The change in PDs can then be used to calculate the Expected Loss due to the shock on the portfolio level.

calculate_trisk_trajectory()

Calculate transition shock trajectory

check_expected_missings()

Check expected missing patterns

check_financial_data()

Check financial data

check_level_availability()

Check that required levels of a variable are available in data

check_results()

Check results

check_valid_financial_data_values()

Check if values in financial data are plausible

company_technology_asset_value_at_risk()

Calculate percentage value change between scenarios for equity (and temporarily other asset types) on the company-ald_business_unit level

convert_cap_to_generation()

Translate power capacity to power generation. Units of generated power are assumed to be sold and hence get priced in the net profit calculations. This also entails converting MWh into MW per year, since we calculate yearly profits.

convert_power_cap_to_generation()

Translate power capacity to power generation

customise_output_path()

Customise output path

data_path()

conveniently access stress test related files in the directory set via envvar or options

degrees()

Insert the symbol for degrees

dividend_discount_model()

Calculates discounted net profits based on a dividends discount model

dropbox_exists()

Does this computer have a local copy of 2dii's dropbox folder?

fail_if_input_args_are_missing()

Checks if input args are missing

fill_annual_profit_cols()

Fill missing values on annual_profits

filter_negative_late_and_sudden()

Remove negative late and sudden rows

generate_litigation_shocks()

Generate litigation scenario shock from a start year that represents when a litigation settlement is reached.

generate_transition_shocks()

Generate transition scenario shock from a start year that represents when a large scale climate transition policy is deployed.

geographies_for_sector()

Obtain available geographies for sector

get_end_year()

Get End year from data

get_iter_var()

Get name of iterator variable

get_scenario_geography_x_ald_sector()

Get scenario_geography_x_ald_sector

keep_merton_compatible_rows()

Keep rows that fulfill constraints of the merton model

credit_type_lookup

Lookup valid values

path_dropbox_2dii()

Easily access directories in your local copy of 2dii's Dropbox folder

process_production_data()

Process data of type indicated by function name

read_capacity_factors_power()

Read in power capacity factors from csv and check that all expected columns are given.

read_carbon_data()

Read in carbon price data from ngfs data

read_financial_data()

Read in company financial data processed from eikon exports and AR master data that contain information on multiple credit risk inputs

read_price_data()

Read in price data

read_production_data()

Read in AR PAMS production data.

read_scenario_data()

Read in scenario data

report_all_duplicate_kinds()

Checks data for missings and duplicates

report_company_drops()

Report dropped companies

report_dropped_company_names()

Inner join datasets and report number of dropped rows

report_duplicates()

Report duplicate rows

report_missing_col_combinations()

Identify and report missing value combinations

report_missings()

Report missing

run_lrisk()

Run stress testing for provided asset type.

run_trisk()

Run stress testing for provided asset type.

scenario_for_sector_x_geography()

Obtain available scenario_x_source for geography - sector combinations

set_baseline_trajectory()

Defines which scenario values to use for the baseline trajectory in the stress test.

set_litigation_trajectory()

Defines which scenario values to use for the production trajectory after a litigation event in the LRISK stress test.

set_trisk_trajectory()

Defines which scenario values to use for the late & sudden trajectory in the stress test.

st_process_agnostic()

Process input ST data

stress_test_arguments

A dataset describing the arguments of run_trisk() and run_lrisk()

subtract_settlement()

Calculate annual profits after payout of settlement in lrisk

validate_data_has_expected_cols()

Validate that a data frame contains expected columns

validate_file_exists()

Validate that a file exists in a given directory

validate_input_values()

Check that input values are valid

validate_values_in_range()

Validate that values are within range

wrangle_results()

Wrangle results

write_stress_test_results()

Write stress test reports to output dir