gcubed.runners.simple_runner

This module contains the SimpleRunner class - used to run standard G-Cubed experiments.

It supports the types of experiments that could be done using the Ox implementation of G-Cubed.

Overview

Runs a simplified simulation experiment.

  1. The model is loaded and used to generate baseline projections.
  2. The experiment design is loaded, setting out each of the events being simulated as a separate simulation layer.
  3. The simulation layers are loaded and applied to the model to generate projection updates.

Projections based on any of the simulation layers can be compared to projections from the baseline or from other simulation layers associated with the experiment.

This simple runner has the following limitations compared to the advanced runner:

  1. No relinearisations of the model in years after the first projection year.
  2. Linearisation is done around initial database values instead of a "strict model solution".
  3. Interest rates are adjusted to their long-run inflation-neutral values before doing linearisation.
  4. Interest rates are set to their long-run inflation-neutral values at the start of projections and this adjustment to interest rates is eliminated using constant adjustments to interest rates, once the full set of baseline projections have been generated.

These limitations are imposed when the run is triggered. Warnings are issued if users try to override these limitations.

SimpleRunner( working_directory: str, configuration_file: str, experiment_design_file: str = None)

Constructor

When the constructor is called, the runner loads the configuration and the model, ready for running. Call the run method when you are ready to start model linearisation etc. after having set properties for the runner to determine its behaviour, for example, how linearisation is done in relation to the neutral real interest rate.

Arguments

working_directory: The directory where the results and logs are to be stored.

configuration_file: The location of the configuration file, as an absolute path or relative to the specified working directory.

experiment_design_file: The optional location of the experiment design CSV file, as a relative path directory to the experiment design file from the simulations directory within the model directory (the model directory contains the configuration file).

Exceptions

Raises exceptions if the working directory is not specified correctly.

Raises exceptions if the configuration file is not specified correctly.

Raises exceptions if the experiment design file is not specified correctly.

def run(self):

Overview

Do the actual work of running the model and performing the experiment.

Call this method after setting up the runner.

Once the experiment has run, you can retrieve projections from the simulation layer(s) of interest and the baseline for comparison and analysis purposes.