gcubed.data.linearisation_database

This module contains the LinearisationDatabase class, used for model linearisation.

class LinearisationDatabase(gcubed.data.database.Database):

Overview

Provides convenience methods for all classes.

All G-Cubed classes inherit from this base class.

LinearisationDatabase(database: gcubed.data.database.Database, base_year: int)

Constructor

Manage loading and provision of linearisation database.

Encapsulates all of the information about the linearisation data used by a Model.

Note that this data differs from that used for model calibration in that the data for gdp unit variables has been scaled by the GDP ratio for each region to the US.

Arguments

database: the database that this calibration database was derived from.

base_year: the base year for the database.

The SYM processor output

The model configuration

def rebase(self):

Rebase a database so indices have a new base year. This can be used to convert the database used for calibration to a database with the base year equal to the start year for projections (eg. 2011 to 2018).

Note that this script draws on the approach in the G-Cubed utilities/rebasedata.ox script.

Arguments

 new_base_year (int): a YYYY formatted new base year for the database.

Exceptions

Exception is thrown if the database does not contain data for the new base year.

Exception is thrown if the database does not contain data for the year after the new base year if the model has lagged index variables.

def get_non_negative_data( self, variable_name_prefix: str, years: list) -> pandas.core.frame.DataFrame:

Overview

This method should not be called on a linearisation database

Arguments

variable_name_prefix: The variable name prefix.

years: the list of years for which the data is to be retrieved. Note that this can be a list of integer values or a list of strings.

Exceptions

This method always raises an exception because the method should not be called on a linearisation database.