DEMOS Configuration Structure

class demos.config.DEMOSConfig(*args, **kwargs)[source]

Bases: BaseModel

Global configuration for DEMOS. Individual fields in this class control the configuration of each module.

random_seed: int
base_year: int

Year represented in synthetic population input

forecast_year: int = 2020

Last year of simulation

output_dir: str = '../data/output'

Path to DEMOS outputs

output_fname: str = None

Name of output HDF5 file. Defaults to demos_output_{forecast_year}.h5.

output_tables: list[str] = None

List of orca tables to include in output

calibrated_models_dir: str = None

Path to directory with calibration models

inconsistent_persons_table_behavior: Literal['error', 'fix', 'ignore'] = 'error'

Behavior of inconsistent persons input table

initialize_empty_tables: list[str] = None

Name of tables to be initialized as empty

tables: Optional[list[Annotated[H5TableSource | CSVTableSource]]] = None

List of tables to be loaded into orca

modules: Optional[list[str]] = None

List of modules to be run

require_lcm_county_column()

Individual Modules configuration

class demos.config.HHRebalancingModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

Configuration for Household Rebalancing module

control_table: str
control_col: str
geoid_col: str
class demos.config.EmploymentModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

simultaneous_calibration_config: Optional[SimultaneousCalibrationConfig] = None
enter_model_calibration_procedure: Optional[CalibrationConfig] = None
exit_model_calibration_procedure: Optional[CalibrationConfig] = None
check_calibration_config_exclusivity()
class demos.config.HHReorgModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

simultaneous_calibration_config: Optional[SimultaneousCalibrationConfig] = None
geoid_col: Optional[str] = None
class demos.config.MortalityModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

calibration_procedure: Optional[CalibrationConfig] = None
class demos.config.BirthModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

calibration_procedure: Optional[CalibrationConfig] = None
class demos.config.KidsMovingModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

geoid_col: str
calibration_target_share: float = 0.12
calibration_tolerance: float = 0.001
max_iter: int = 100
class demos.config.AgingModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

senior_age: int = 65

Age at which a person qualifies as senior

class demos.config.IncomeModuleConfig(*args, **kwargs)[source]

Bases: BaseModel

Configuration for the Income module.

The income model predicts household income as nominal dollars for the year in which it was estimated (inflation_reference_year). When inflation_reference_year and inflation_adjustment_table are both provided, predictions are automatically scaled to the current simulation year using cumulative annual CPI adjustment factors read from that table.

Optionally, a calibration procedure can be configured to nudge aggregate income predictions toward observed values (same mechanics as the mortality and birth modules).

Inflation adjustment table format (index_col = "year"):

year,adjustment
2011,0.030
2012,0.021
...

The adjustment column must contain decimal annual inflation rates (e.g. 0.030 represents 3.0 %). The table must cover every year from inflation_reference_year (exclusive) through the last simulation year (inclusive). If the current simulation year equals inflation_reference_year, no adjustment is applied.

calibration_procedure: Optional[CalibrationConfig] = None

Optional calibration procedure to align aggregate predicted income with observed aggregate values. Uses the same RMSE-based mechanics as the mortality and birth calibration procedures. Omit (or comment out) this block to skip calibration.

inflation_adjustment_table: Optional[str] = None

Name of the orca table containing annual CPI inflation adjustment factors, or an inline DataSource definition (like a [[tables]] entry) that will be loaded automatically. The table must be indexed by year and include an adjustment column with decimal annual inflation rates. Must be set together with inflation_reference_year.

inflation_reference_year: Optional[int] = None

The reference year of the income model estimation. Predicted income values are expressed in nominal dollars for this year and will be scaled forward (or backward) to the current simulation year using the cumulative product of the annual adjustment factors. Must be set together with inflation_adjustment_table.