gcubed.data.linearisation_database
This module contains the LinearisationDatabase
class, used
for model linearisation.
Overview
Provides convenience methods for all classes.
All G-Cubed classes inherit from this base class.
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.
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.
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.
Inherited Members
- gcubed.data.database.Database
- variables
- data
- variables_count
- years_count
- years_column_names
- base_year
- first_available_year
- last_available_year
- export_to_csv
- rhs_vector_value
- get_data_and_varmap_indices
- get_data_and_varmap_indices_for_matching_variables
- get_data
- update_data
- has_data
- has_data_for_all_projection_years
- set_up_yratr
- yratr_scaling_factor
- yratr_scaling_factor_for_variable
- value
- set_value
- save