.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/hybrid_choice/config.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_hybrid_choice_config.py: Configuration ============= Central configuration for running estimation scripts. This module defines the :class:`Config` dataclass, which gathers all high-level options controlling the behavior of the estimation pipeline. A single instance of :class:`Config` is typically created in a small configuration file (e.g. `conf_01.py`, `conf_02.py`) and passed to the main execution routine. The goal of this module is to provide a clear, typed, and immutable container for experimental settings, so that the same codebase can be reused across multiple configurations without duplication. Michel Bierlaire Thu Dec 25 2025, 08:08:37 .. GENERATED FROM PYTHON SOURCE LINES 20-55 .. code-block:: Python from dataclasses import dataclass from typing import Literal @dataclass(frozen=True) class Config: """Configuration of a single estimation run. Each field controls a specific modeling or estimation choice: - ``name``: Human-readable identifier for the configuration (used for logging and output naming). - ``latent_variables``: Specifies whether latent variables are included in the model (``"zero"``) or whether the full hybrid choice model with two latent variables is used (``"two"``). - ``choice_model``: Indicates whether a discrete choice model is included alongside the latent-variable measurement model (``"yes"`` or ``"no"``). - ``estimation``: Estimation paradigm, either Bayesian (``"bayes"``) or maximum likelihood (``"ml"``). - ``number_of_bayesian_draws_per_chain``: Number of posterior draws per MCMC chain when Bayesian estimation is used. - ``number_of_monte_carlo_draws``: Number of Monte Carlo draws used for numerical integration in maximum likelihood estimation. The dataclass is frozen to guarantee immutability during execution and improve reproducibility. """ name: str latent_variables: Literal["zero", "two"] choice_model: Literal["yes", "no"] estimation: Literal["bayes", "ml"] number_of_bayesian_draws_per_chain: int number_of_monte_carlo_draws: int .. _sphx_glr_download_auto_examples_hybrid_choice_config.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: config.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: config.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: config.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_