Running ActivitySim in Estimation Mode#

ActivitySim is run in estimation mode to read ActivitySim-format travel survey files, and apply the ActivitySim submodels to write estimation data bundles (EDBs) that contains the model utility specifications, coefficients, chooser data, and alternatives data for each submodel. These EDBs are then used with Larch to re-estimate the model parameters.

ActivitySim can be run in estimation mode by including a few extra settings in the estimation.yaml config file. The key setting in this file is the enabled setting, which must be set to True in order to run in estimation mode. The default value for this setting is False, so if it is not explicitly set to True, ActivitySim will run in normal simulation mode, and everything else in the estimation.yaml config file will be ignored. These settings are documented below. After running ActivitySim in estimation mode, the EDBs will be written to disk, and can be used with Larch to re-estimate the model parameters.

Configuration Settings#

settings activitysim.core.estimation.EstimationConfig#

Bases: PydanticReadable

Fields:
Validators:
field DELETE_MP_SUBDIRS: bool = True#

Flag to delete the multiprocessing subdirectories after coalescing the results.

Typically only used for debugging purposes.

Validated by:
field EDB_FILETYPE: Literal['csv', 'parquet', 'pkl'] = 'parquet'#

File type for dataframes written to the estimation data bundles.

Options are ‘csv’, ‘parquet’, or ‘pkl’. When set to ‘parquet’, if file writing fails for any reason, it will fall back to ‘pkl’. This typically will happen when the data types in the dataframe are not compatible with parquet (e.g. Python ‘object’ dtype with mixed format content).

Legacy ActivitySim used ‘csv’ to maximize compatibility with other software. As of version 1.4, the default changed to ‘parquet’, which is more efficient and better preserves data types.

Validated by:
field SKIP_BUNDLE_WRITE_FOR: list[str] = []#

List of bundle names to skip writing to disk.

This is useful for saving disk space and decreasing runtime if you do not care about the estimation output for all models.

Validated by:
field bundles: list[str] = []#

List of component names to create EDBs for.

Validated by:
field enable: bool = False#

Flag to enable estimation.

Validated by:
field estimation_table_recipes: dict[str, EstimationTableRecipeConfig] = None#

This option has been removed from the user-facing configuration file.

Mapping of estimation table recipe names to their configurations.

The keys of this mapping are the names of the estimation table recipes. The recipes are generally related to the generic model types, such as ‘simple_simulate’, ‘interaction_simulate’, ‘interaction_sample_simulate’, etc. The values are the configurations for the estimation table recipes.

Validated by:
field estimation_table_types: dict[str, str] = {}#

Mapping of component names to estimation table types.

The keys of this mapping are the model component names, and the values are the names of the estimation table recipes that should be used to generate the estimation tables for the model component. The recipes are generally related to the generic model types, such as ‘simple_simulate’, ‘interaction_simulate’, ‘interaction_sample_simulate’, etc.

Validated by:
field survey_tables: dict[str, SurveyTableConfig] = {}#

Mapping of survey table names to their configurations.

Each survey table should have a file name and an index column. These files are where the survey data is read from while running in estimation mode.

Validated by:
validator check_estimation_table_recipes  »  all fields#
validator validate_estimation_table_types  »  all fields#

Survey Table Settings#

settings activitysim.core.estimation.SurveyTableConfig#
Config:
  • arbitrary_types_allowed: bool = True

Fields:
field df: pd.DataFrame | None = None#
field file_name: str [Required]#
field index_col: str [Required]#
class Config#