knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This vignette describes in detail, how to run a climate transition risk stress test, using the function run_trisk() to calculate the credit risk. Additionally, the function run_lrisk() is elaborated upon, which can be used to run the climate litigation stress test.

Assumptions

In order to keep this vignette concise, we assume the following has been set up:

  1. R and RStudio are installed.
  2. All required R packages are installed, specifically r2dii.climate.stress.test. Note that this may require installing additional packages. You will be prompted to install these in case any are missing.
  3. The input files are organized in a folder structure consistent with the one described in the vignette Set up project directories.

Running the Analysis

The climate transition risk stress test can be run for a single set of parameters with one value per input argument or as a sensitivity analysis, where one of the input arguments is iterated over and gets a vector of parameters and all other arguments get one input value each. We will look at both cases.

Use library() to attach the package

library(r2dii.climate.stress.test)

Running the Stress Test for one scenario

File paths must always be specified in the arguments of run_trisk() or run_lrisk(). They are the only arguments which do not have a default value and must be set by the user.

run_trisk(
  input_path = "/example_project/project_input/",
  output_path = "/example_project/output"
)
run_lrisk(
  input_path = "/example_project/project_input/",
  output_path = "/example_project/output",
  return_results = TRUE
)

This will calculate the transition or litigation risk stress test and write the results, along with a log file, into the designated output directory, using the default values for all detail arguments.

NOTE: The default mode will not return any objects within the R session. We find this is the easiest and most user friendly way to obtain results. We alternatively provide the option that the function returns a list holding the result objects by setting the argument return results to TRUE . This allows the user to inspect and further analyze the data directly in R.

Available scenario geopgrahies and sectors

The r2dii.climate.stress.test currently supports a number of scenario geographies and four of the PACTA for Banks sectors of company production. They are the following:

scenario_geography_x_ald_sector <- get_scenario_geography_x_ald_sector("/example_project/project_input/")

sectors <- unique(scenario_geography_x_ald_sector$ald_sector)
print(sectors)

Note that the supported sectors do depend on the scenario_geography (i.e. the geographical region (concerning asset location) results shall be calculated for). All supported scenario geographies are the following:

scenario_geographies <- unique(scenario_geography_x_ald_sector$scenario_geography)
print(scenario_geographies)

One can use a helper function to obtain the supported scenario_geographies for a sector as follows:

geographies_for_sector("/example_project/project_input/", "Coal")

Input arguments

Specifications on the detail arguments are summarized in the following overview. The defaults that are used if the argument is not adjusted when calling run_trisk() or run_lrisk() can be found in column default. The user may change any detail argument by explicitly passing it to the function. Note that there are allowed values for each of the inputs. For logical or character variables refer to column allowed, for numeric variables the allowed values are the range from min (inclusive) to max (inclusive).

stress_test_arguments

Note that special special rules apply for the variables baseline_scenario and shock_scenario. Baseline and shock scenarios can in principle be selected from the following:

scenarios <- unique(scenario_geography_x_ald_sector$scenario)
print(scenarios)

Which scenarios are supported however depends on the analysed sector and scenario_geography.

NOTE: It is strongly recommended to select a baseline_scenario and a shock_scenario from the same scenario source, as indicated by the part of the scenario name in front of the underscore symbol.

Understanding the input arguments

The meaning of each of the detail arguments is as follows:

lrisk holds the following three additional arguments:

Adjusting the input arguments

The user may want to run a stress test that is tailored to their assumptions about a plausible transition risk shock scenario. For example, the user could decide to set a lower risk_free_rate and shock the companies earlier than by default, using:

run_trisk(
  input_path = "/example_project/project_input/",
  output_path = "/example_project/output",
  risk_free_rate = 0.01,
  shock_year = 2028
)

NOTE: One important input argument that affects the behavior of where the results are written, is the argument return_results. Per default it is set to FALSE, which means that results are written as csv files to a sub directory in the output_path and the user must open these files to view the results. If the user wants to view the results directly in R, they can set the argument to TRUE which will return them as a list of data frames in the R session. This means they are not written to the designated output_path however, so the user must do this by themselves if the results ought to be kept. In this case, the user must still provide an output path though, as every calculation will write a log file.

Output files

The output files are written into a sub directory of the path indicated as output_path in the function call. The name of the sub directory is created from the time stamp of the analysis and a suffix. The suffix _standard is used when each argument uses a single parameter value. If a sensitivity analysis (see below) is run the name of the varied detail variable is used. The sub directory will be generated automatically, this way we ensure that no existing results are overwritten.

Running a Sensitivity Analysis for the Stress Test

In case the user wants to understand the sensitivities of the model to the input parameters mentioned above, it is straight forward to run a sensitivity analysis that does exactly that.

In order to do that, one simply passes a vector of allowed values for one (and only one) of the detail arguments when running the stress test function. This will lead to the model iterating over the set of values passed for the chosen argument, while keeping all other input arguments constant.

If the user wishes to understand the impact of the shock_year on the results for example, they can run the following:

run_trisk(
  input_path = "/example_project/project_input/",
  output_path = "/example_project/output",
  shock_year = c(2025, 2028, 2032, 2035)
)

This will yield outputs with four versions of the stress test, one for each of the shock years indicated. All the results will be written into one file per output type for ease of use, e.g.:

NOTE: The suffix of the files is now changed to mirror which variable was iterated over. This enables the user to run multiple different sensitivity analyses for a project and easily navigate these.

When running a sensitivity analysis on one input, the user can still use other values than the default parameters for the other input arguments.

For example, when iterating over the shock_year, it is still possible to use a risk_free_rate lower than the default like so:

run_trisk(
  input_path = "/example_project/project_input/",
  output_path = "/example_project/output",
  risk_free_rate = 0.01,
  shock_year = c(2025, 2028, 2032, 2035)
)

NOTE that the selected detail arguments will be written to the result files so that it is always possible to understand which parameters were used in any given calculation.

Interpretation of the output files

Detailed explanations of the result files can be found in the vignette: Understand the output files of the transition risk stress test.



2DegreesInvesting/r2dii.climate.stress.test documentation built on June 6, 2024, 8:23 a.m.