gcubed.benchmarking.benchmarks
This module contains the Benchmarks
class, used to create
a set of benchmarking information about a G-Cubed model.
This enables comparisons of models across models and across
versions of the gcubed
package used to run them.
Overview
Create a set of benchmark results associated with a model and a version of Ox.
Overview
Generates all of the benchmarks that can be used to determine the outcome of running the given experiment.
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.
relinearisation_years
: The list of years where a
relinearisation is required. This list can be empty
in which case the model is not relinearised. To generate a
list of years, from 2018 to say, 2030, you can supply the
following as as this parameter value:
list(range(2018, 2031))
. (Note that the upper bound is not
included in the range.) Defaults to the empty list.
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).
True
if the baseline linearisation is around neutral real interest rates
and False
if they are around database values.
Defaults to True
.
True
if the baseline linearisation is around the neutral real interest rate
and False
if it is around database values.
True
if relinearisations are around the neutral real interest rate
and False
if they are around previous projection values
in the relinearisation year.
True
if the runner is to relinearise the model in all event years
as well as the years specified and False
if the runner is to relinearise the model only
in the years specified.
Defaults to False
.
If necessary, modify this setting once the running is instantiated but before the experiment is run.
The (possibly empty) list of relinearisation years (all in YYYY format).
True if the model linearisation is done around a strict model solution and False if the model linearisation is to instead be done around actual data values sourced from the model database or from a previous model projection. Set this to False for standard linearisation as has been done for G-Cubed for decades. Set this to True if the actual data values are to be adjusted to find similar values that exactly solve all of the equations in the model before then linearising around those similar values.
This property defaults to False
.
True
if the relinearisation starts with neutral real interest rates
and False
otherwise.
Defaults to False
.
The first projection year observed (database) values of variables adjusted by intertemporal constants.
The first projection year original (not adjusted by intertemporal constants) projections of variables adjusted by intertemporal constants
Arguments
lhs_vector_name: The name of the LHS vector.
Returns
The first projection year State Space Form evaluation for the given LHS vector.
Arguments
vector_name: The name of the RHS version of the LHS vector (e.g. x1r
for vector x1l
)
Returns
The first projection year data difference from State Space Form evaluation for the given vector.
Arguments
lhs_vector_name: The name of the vector - one of:
- yxr
- yjr
- exz
- z1l
Returns
The first projection year original (not adjusted by constants) projection for the named vector.
The partial_derivatives wrt intertemporal constants used in Newton's method to compute the intertemporal constants.
The intertemporal constants used to match costate variable projections to their observed values in the first projection year.
Arguments
region: The region code
Returns
The productivity growth projections for the region
Arguments
region: The region code
Returns
The effective labour productivity growth projections for the region
Potential output growth, for all regions, with rows indexed by region.
Arguments
region: the region to get the energy usage efficiency gain for.
Returns
The energy usage efficiency gain projections for all sectors in the region.
Consumption energy usage efficiency gains for all regions, with rows indexed by region.
The baseline exogenous variable projections.
The baseline yxr (state) vector in the first projection year.
A list of tuples where each tuple contains the details about a projection. The projections can be baseline projections or simulation layers.
The projection details are listed in the order that they were generated.
The details for each projection are:
- The first projection year
- The last projection year
- The projection name
- The raw projections dataframe
- The database projections dataframe
- The publishable projections dataframe
- The annotated publisable projections dataframe
The list of RHS vector names, for vectors that are also LHS vectors in the model.
The dataframe of calibrated model parameter values, indexed by parameter names.
A dictionary of all parameters, keyed by parameter name. This makes it easier to relate parameter values to specific set members.
Arguments
rhs_vector_name: The RHS vector name
Returns
Initial (first projection year) RHS vector values, used in linearisation.
* Linearisation information. *
Arguments
lhs_vector_name: The LHS vector name
Returns
The values for the LHS vectors computed using the nonlinear equations in the model for the first projection year.
* Linearisation information. *
Arguments
lhs_vector_name: The LHS vector name
rhs_vector_name: The RHS vector name
Returns
The partial derivatives matrix relating the LHS vector to the RHS vector in the linearised model.
* Linearisation information. *
Arguments
lhs_vector_name: The LHS vector name
rhs_vector_name: The RHS vector name
Returns
The delta matrix relating the LHS vector to the RHS vector in the state space form of the model.
* Linearisation information. *
The eigenvalues of the transition matrix of the stable manifold.