gcubed.model_parameters
This module contains the Parameter calibration system for G-Cubed.
Generate model-aware default user parameters in SYM region order.
Include a decimal government spending share of 0.19 for each region when
the compiled model declares the gdpshare parameter.
Arguments
sym_data : SymData
The SymData object containing model data such as regions and sectors.
Returns
The generated template user parameters DataFrame with regions matching the current model.
Generate technology advancement deviations for all sectors and years.
Arguments
advancement_rate : float
The deviation in percentage points from configured steady-state log
growth. Zero follows the configured frontier rate. These cells must
be exactly zero for the final 50 projection years when loaded.
sectors : List[str]
The list of sectors in the model.
years : List[str]
The list of projection years in the model.
Returns
A DataFrame of technology advancement rates with sectors as the index and years as the columns.
Generate a DataFrame of technology catchup rates for all regions, sectors, and years.
Arguments
long_run_catchup_rate : float
The long-run catchup rate (e.g., 2 for 2%).
regions : List[str]
The list of regions in the model.
sectors : List[str]
The list of sectors in the model.
years : List[str]
The list of projection years in the model.
Returns
A DataFrame of technology catchup rates with a MultiIndex of (region, sector) and years as the columns.
Generate a DataFrame of technology gaps for all regions and sectors.
Arguments
regions : List[str]
The list of regions in the model.
sectors : List[str]
The list of sectors in the model.
Returns
A DataFrame of technology gaps sector rows and region columns.
Generate a DataFrame of autonomous energy efficiency improvements for all regions, sectors, and years.
Arguments
regions : List[str] The list of regions in the model.
sectors : List[str] The list of sectors in the model.
years : List[str] The list of projection years in the model.
rate : float, optional The annual improvement rate (default is 1.0, meaning 1 percent improvement).
Returns
A DataFrame of autonomous energy efficiency improvements with a MultiIndex of (region, sector) and years as the columns.
Remove the template data files and user parameters CSV files if they exist.
Overview
Write generated user parameters, optionally preserving existing user-owned
rows while removing the obsolete runtime-derived capital-return family.
Add a missing gdpshare row when it is present in the generated table;
preserve any existing regional values.
Arguments
generated_user_parameters: Complete generated parameter table.output_file_path: Destinationuser_parameters.csvpath.preserve_existing_user_parameters: When true and the destination exists, preserve every non-derived row and cell exactly, adding only the missing generatedgdpsharerow.
Returns
None.
Exceptions
Raises ValueError for duplicate rows, a changed header, or a partial
obsolete capital-return family. Propagates filesystem errors.
Generate the template baseline data files and user parameters CSV files.
Arguments
model_configuration : ModelConfiguration
The ModelConfiguration object containing model configuration details.
overwrite : bool, optional Whether to overwrite existing files (use the standard names for the files). Default is False. If this is set to False, the files will be saved with "_template" appended to their names.
preserve_existing_user_parameters : bool, optional
Whether an overwrite should preserve existing user-owned values while
removing obsolete runtime-derived rows and adding a missing generated
gdpshare row. Defaults to false.
Returns
None.
G-Cubed