G-Cubed
Python G-Cubed 5.0.2.0 · build 1
Generation details
Source revision
4c4a95aded1b5ca5e8f9c292ad8250440cd9c18b (modified inputs)
Source fingerprint
e2c719b38e03c6b1748f10e26bc1caf1ead5674dd1beee6628a6ccf7b90fd39b
Generated (UTC)
2026-11-11T03:06:22.844261+00:00
Generator
pdoc 16.0.0, CPython 3.14.8
Generation metadata

gcubed.data.calibration_database

This module contains the CalibrationDatabase class, used for parameter calibration.

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

Overview

Provides convenience methods for all classes.

All G-Cubed classes inherit from this base class.

CalibrationDatabase( database: gcubed.data.database.Database, base_year: int, allowed_missing_logged_variable_names: Collection[str] = ())

Constructor

Create a new calibration database from an existing database.

The calibration database is used to calibrate the model parameters.

The transformation from the original database is simple enough, rebasing to the specified base year and dividing all values by 100.

Arguments

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

base_year: the base year for the database.

allowed_missing_logged_variable_names: active logged values that are intentionally calculated by a later database-generation stage. Missing values are retained for these rows; negative and infinite values remain invalid.

Exceptions

Raises ValueError when logged observations are invalid, except for explicitly deferred missing rows.

The SYM processor output

The model configuration details

logged_zero_preparation_policy_version: str

Version of the logged-zero preparation applied to this database.

logged_zero_preparation_diagnostics: pandas.DataFrame

Return substitution provenance without exposing mutable internal state.

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.