Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Biogeme 3.3.2 documentation
Biogeme 3.3.2 documentation
  • Install
  • Examples
    • Some simple examples for beginners
      • Estimation of a binary logit model
      • Configuring Biogeme with parameters
      • Importing model specification
      • Estimation results
      • Using the estimated model
      • Data definition for the simple tutorial
      • Model specification for the simple tutorial
    • Biogeme examples for the Swissmetro data
      • 1a. Estimation of a logit model
      • 1b. Illustration of additional features of Biogeme
      • 1c. Illustration of the quick_estimate of Biogeme
      • 1d. Simulation of a logit model
      • 1e. Logit model with several algorithms
      • 2. Estimation with weights: WESML
      • 3. Moneymetric and heteroscedastic specification
      • 4. Out-of-sample validation
      • 5a. Mixture of logit models with Monte-Carlo integration
      • 5b. Mixture of logit models with numerical integration
      • 5c. Simulation of a mixture model
      • Mixture of logit
      • 6a. Mixture of logit models with uniform distribution
      • 6b. Mixture of logit models with uniform MLHS draws
      • 6c. Mixture of logit models with uniform distribution and numerical integration
      • 7. Latent class model
      • 8. Box-Cox transforms
      • 9. Nested logit model
      • 10. Nested logit model normalized from bottom
      • 11a. Cross-nested logit
      • 11b. Simulation of a cross-nested logit model
      • 11c. Cross-nested logit with a sparse structure
      • 12. Mixture of logit with panel data
      • 13. Simulation of panel model
      • 14. Nested logit with corrections for endogeneous sampling
      • 15a. Discrete mixture with panel data
      • 15b. Discrete mixture with panel data
      • 16. Discrete mixture with panel data
      • 17a. Mixture with lognormal distribution
      • 17b. Mixture with lognormal distribution and numerical integration
      • 18a. Ordinal logit model
      • 18b. Ordinal probit model
      • 19. Calculation of individual level parameters
      • 20. Estimation of several models
      • 21a. Assisted specification
      • 21b. Specification of a catalog of models
      • 21c. Re-estimate the Pareto optimal models
      • Assisted specification
      • Specification of a catalog of models
      • Re-estimate the Pareto optimal models
      • 23a. Binary logit model
      • 23b. Binary probit model
      • 24. Mixture of logit with Halton draws
      • 25. Triangular mixture of logit
      • 26. Triangular mixture with panel data
      • Data preparation for Swissmetro (binary choice)
      • Data preparation for Swissmetro
      • Panel data preparation for Swissmetro
    • Biogeme examples for Bayesian inference with the Swissmetro data
      • 1a. Estimation of a logit model (Bayesian)
      • 1b. Estimation of a logit model (Bayesian)
      • 1c. Simulation of a logit model (traditional and Bayesian)
      • 2. Logit and sample with weights (Bayesian)
      • 3. Moneymetric and heteroscedastic specification
      • 4. Out-of-sample validation
      • 5. Mixture of logit models: normal distribution
      • 6. Mixture of logit models: uniform distribution
      • 7. Latent class model
      • 8. Box-Cox transforms
      • 9. Nested logit model
      • 10. Nested logit model normalized from bottom
      • 11. Cross-nested logit
      • 12. Mixture of logit with panel data
      • 15. Discrete mixture with panel data
      • 16. Latent class model with panel data
      • 17. Mixture with lognormal distribution
      • 18a. Ordinal logit model
      • 18. Ordinal probit model
      • 19. Calculation of individual level parameters
      • 23a. Binary logit model
      • 23b. Binary probit model
      • 25. Triangular mixture of logit
      • 26. Triangular mixture with panel data
      • Data preparation for Swissmetro (binary choice)
      • Data preparation for Swissmetro
      • Panel data preparation for Swissmetro
    • Calculating indicators with Biogeme
      • Examples of mathematical expressions
      • Estimation and simulation of a nested logit model
      • Simulation of a choice model
      • Calculation of market shares
      • Calculation of revenues
      • Direct point elasticities
      • Cross point elasticities
      • Arc elasticities
      • Calculation of willingness to pay
      • Specification of a nested logit model
    • Timing function evaluation
      • Timing of a logit model
      • Timing of a cross-nested logit model
      • Timing of a logit model
      • Comparison of execution times
      • Data preparation for Swissmetro
      • Tool for timing an expression
      • Timing of any expression
    • Monte-Carlo integration with Biogeme
      • Specification of the mixtures of logit
      • Simple integral
      • Various integration methods
      • Antithetic draws
      • Antithetic draws explicitly generated
      • Numerical integration
      • Monte-Carlo integration
      • Estimation of mixtures of logit
      • Mixtures of logit with Monte-Carlo 10_000 draws
      • Mixtures of logit with Monte-Carlo 500 draws
      • Mixtures of logit with Monte-Carlo 10_000 antithetic draws
      • Mixtures of logit with Monte-Carlo 500 antithetic draws
      • Mixtures of logit with Monte-Carlo 10_000 Halton draws
      • Mixtures of logit with Monte-Carlo 500 Halton draws
      • Mixtures of logit with Monte-Carlo 10_000 MLHS draws
      • Mixtures of logit with Monte-Carlo 500 MLHS draws
      • Mixtures of logit with Monte-Carlo 10_000 antithetic MLHS draws
      • Mixtures of logit with Monte-Carlo 2000 antithetic MLHS draws
      • Data preparation for Swissmetro
      • Data preparation for Swissmetro: one observation
    • Biogeme examples for hybrid choice models
      • Choice model
      • Configuration
      • Model estimation
      • Prepare for server
      • Latent variables
      • Likert indicators
      • MIMIC model
      • Data preparation
      • 1. Choice model only - maximum likelihood estimation
      • 2. MIMIC model - maximum likelihood estimation
      • 3. Hybrid choice model - maximum likelihood estimation
      • 4. Choice model only - Bayesian estimation
      • 5. MIMIC model - Bayesian estimation
      • 6. Hybrid choice model - Bayesian estimation
      • Read or estimate model parameters
    • Assisted specification with Biogeme
      • Combination of many specifications
      • Base model
      • Investigation of several choice models
      • Catalog of nonlinear specifications
      • Catalog for alternative specific coefficients
      • Catalog for segmented parameters
      • Segmentations and alternative specific specification
      • Combine many specifications: exception is raised
      • Combine many specifications: assisted specification algorithm
      • One model among many
      • Re-estimation of best models
      • Example of a catalog
    • Sampling of alternatives
      • List of alternatives
      • Compare parameters
      • Logit
      • Nested logit
      • Cross-nested logit
      • Model specification
      • Model specification
      • True parameters
  • Configuration parameters
  • Native draws
  • .biogeme module
    • biogeme.assisted module
    • biogeme.audit_tuple module
    • biogeme.bayesian_estimation module
      • biogeme.bayesian_estimation.bayesian_results module
      • biogeme.bayesian_estimation.check_shape module
      • biogeme.bayesian_estimation.dimensions module
      • biogeme.bayesian_estimation.html_output module
      • biogeme.bayesian_estimation.pandas_output module
      • biogeme.bayesian_estimation.raw_bayesian_results module
      • biogeme.bayesian_estimation.sampling module
      • biogeme.bayesian_estimation.sampling_strategy module
    • biogeme.biogeme module
    • biogeme.biogeme_logging module
    • biogeme.catalog module
      • biogeme.catalog.catalog module
      • biogeme.catalog.catalog_iterator module
      • biogeme.catalog.central_controller module
      • biogeme.catalog.configuration module
      • biogeme.catalog.controller module
      • biogeme.catalog.generic_alt_specific_catalog module
      • biogeme.catalog.segmentation_catalog module
      • biogeme.catalog.specification module
    • biogeme.check_parameters module
    • biogeme.cnl module
    • biogeme.constants module
    • biogeme.data module
      • biogeme.data.data module
        • biogeme.data.data..ipynb_checkpoints module
      • biogeme.data.mdcev_data module
      • biogeme.data.optima module
      • biogeme.data.swissmetro module
    • biogeme.database module
      • biogeme.database.audit module
      • biogeme.database.container module
      • biogeme.database.mdcev module
      • biogeme.database.panel module
      • biogeme.database.panel_map module
      • biogeme.database.sampling module
    • biogeme.default_parameters module
    • biogeme.deprecated module
    • biogeme.dict_of_formulas module
    • biogeme.distributions module
    • biogeme.draws module
      • biogeme.draws.factory module
      • biogeme.draws.generators module
      • biogeme.draws.management module
      • biogeme.draws.native_draws module
      • biogeme.draws.pymc_draws module
    • biogeme.exceptions module
    • biogeme.expressions module
      • biogeme.expressions.add_prefix_suffix module
      • biogeme.expressions.audit module
      • biogeme.expressions.base_expressions module
      • biogeme.expressions.bayesian module
      • biogeme.expressions.belongs_to module
      • biogeme.expressions.beta_parameters module
      • biogeme.expressions.binary_expressions module
      • biogeme.expressions.binary_max module
      • biogeme.expressions.binary_min module
      • biogeme.expressions.boxcox module
      • biogeme.expressions.collectors module
      • biogeme.expressions.comparison_expressions module
      • biogeme.expressions.conditional_sum module
      • biogeme.expressions.convert module
      • biogeme.expressions.cos module
      • biogeme.expressions.deprecated module
      • biogeme.expressions.derive module
      • biogeme.expressions.distributed_parameter module
      • biogeme.expressions.divide module
      • biogeme.expressions.draws module
      • biogeme.expressions.elem module
      • biogeme.expressions.elementary_expressions module
      • biogeme.expressions.elementary_types module
      • biogeme.expressions.exp module
      • biogeme.expressions.expm1 module
      • biogeme.expressions.individual_draws module
      • biogeme.expressions.integrate module
      • biogeme.expressions.jax_utils module
      • biogeme.expressions.linear_utility module
      • biogeme.expressions.log module
      • biogeme.expressions.logical_and module
      • biogeme.expressions.logical_or module
      • biogeme.expressions.logit_expressions module
      • biogeme.expressions.logzero module
      • biogeme.expressions.minus module
      • biogeme.expressions.montecarlo module
      • biogeme.expressions.multiple_expressions module
      • biogeme.expressions.multiple_product module
      • biogeme.expressions.multiple_sum module
      • biogeme.expressions.named_expression module
      • biogeme.expressions.normalcdf module
      • biogeme.expressions.numeric_expressions module
      • biogeme.expressions.numeric_tools module
      • biogeme.expressions.ordered module
      • biogeme.expressions.panel_likelihood_trajectory module
      • biogeme.expressions.panel_log_likelihood module
      • biogeme.expressions.plus module
      • biogeme.expressions.power module
      • biogeme.expressions.power_constant module
      • biogeme.expressions.prepare_for_panel module
      • biogeme.expressions.random_variable module
      • biogeme.expressions.rename_variables module
      • biogeme.expressions.set_panel_id module
      • biogeme.expressions.sin module
      • biogeme.expressions.times module
      • biogeme.expressions.unary_expressions module
      • biogeme.expressions.unary_minus module
      • biogeme.expressions.validation module
      • biogeme.expressions.variable module
      • biogeme.expressions.visitor module
    • biogeme.expressions_registry module
    • biogeme.filenames module
    • biogeme.floating_point module
    • biogeme.function_output module
    • biogeme.jax_calculator module
      • biogeme.jax_calculator.function_call module
      • biogeme.jax_calculator.multiple_formula module
      • biogeme.jax_calculator.simple_formula module
      • biogeme.jax_calculator.single_formula module
    • biogeme.latent_variables module
      • biogeme.latent_variables.latent_variables module
      • biogeme.latent_variables.likert_indicators module
      • biogeme.latent_variables.measurement_equations module
      • biogeme.latent_variables.ordered_mimic module
      • biogeme.latent_variables.positive_parameter_factory module
      • biogeme.latent_variables.structural_equation module
    • biogeme.likelihood module
      • biogeme.likelihood.bootstrap module
      • biogeme.likelihood.linear_regression module
      • biogeme.likelihood.model_estimation module
      • biogeme.likelihood.negative_likelihood module
    • biogeme.loglikelihood module
    • biogeme.lsh module
    • biogeme.mdcev module
      • biogeme.mdcev.database_utils module
      • biogeme.mdcev.gamma_profile module
      • biogeme.mdcev.generalized module
      • biogeme.mdcev.mdcev module
      • biogeme.mdcev.non_monotonic module
      • biogeme.mdcev.translated module
    • biogeme.model_elements module
      • biogeme.model_elements.audit module
      • biogeme.model_elements.database_adapter module
      • biogeme.model_elements.model_elements module
    • biogeme.models module
      • biogeme.models.boxcox module
      • biogeme.models.boxcox_old module
      • biogeme.models.cnl module
      • biogeme.models.logit module
      • biogeme.models.mev module
      • biogeme.models.nested module
      • biogeme.models.ordered module
      • biogeme.models.piecewise module
    • biogeme.multiobjectives module
    • biogeme.nests module
    • biogeme.optimization module
    • biogeme.parameters module
    • biogeme.partition module
    • biogeme.pymc_calculator module
    • biogeme.results module
    • biogeme.results_processing module
      • biogeme.results_processing.compilation module
      • biogeme.results_processing.estimation_results module
      • biogeme.results_processing.f12_output module
      • biogeme.results_processing.html_output module
      • biogeme.results_processing.latex_output module
      • biogeme.results_processing.pandas_output module
      • biogeme.results_processing.pareto module
      • biogeme.results_processing.raw_estimation_results module
      • biogeme.results_processing.recycle_pickle module
      • biogeme.results_processing.variance_covariance module
    • biogeme.sampling_of_alternatives module
      • biogeme.sampling_of_alternatives.choice_set_generation module
      • biogeme.sampling_of_alternatives.generate_model module
      • biogeme.sampling_of_alternatives.sampling_context module
      • biogeme.sampling_of_alternatives.sampling_of_alternatives module
    • biogeme.second_derivatives module
    • biogeme.segmentation module
      • biogeme.segmentation.database module
      • biogeme.segmentation.one_segmentation module
      • biogeme.segmentation.segmentation module
      • biogeme.segmentation.segmentation_context module
      • biogeme.segmentation.segmented_beta module
    • biogeme.tools module
      • biogeme.tools.checks module
      • biogeme.tools.database module
      • biogeme.tools.derivatives module
      • biogeme.tools.ellipse module
      • biogeme.tools.files module
      • biogeme.tools.formatting module
      • biogeme.tools.jax_multicore module
      • biogeme.tools.likelihood_ratio module
      • biogeme.tools.pandas_to_latex module
      • biogeme.tools.primes module
      • biogeme.tools.pymc_utils module
      • biogeme.tools.serialize_numpy module
      • biogeme.tools.simulate module
      • biogeme.tools.time module
      • biogeme.tools.timeit_context_manager module
      • biogeme.tools.timeit_decorator module
      • biogeme.tools.unique_ids module
      • biogeme.tools.yaml module
    • biogeme.validation module
      • biogeme.validation.cross_validation module
      • biogeme.validation.prepare_validation module
      • biogeme.validation.split_databases module
    • biogeme.validity module
    • biogeme.version module
Back to top
View this page

Gallery of examples¶

Assisted specification with Biogeme¶

Examples discussed in Bierlaire and Ortelli (2023) Assisted Specification with Biogeme 3.2.12

Combination of many specifications

Combination of many specifications

Base model

Base model

Investigation of several choice models

Investigation of several choice models

Catalog of nonlinear specifications

Catalog of nonlinear specifications

Catalog for alternative specific coefficients

Catalog for alternative specific coefficients

Catalog for segmented parameters

Catalog for segmented parameters

Segmentations and alternative specific specification

Segmentations and alternative specific specification

Combine many specifications: exception is raised

Combine many specifications: exception is raised

Combine many specifications: assisted specification algorithm

Combine many specifications: assisted specification algorithm

One model among many

One model among many

Re-estimation of best models

Re-estimation of best models

Example of a catalog

Example of a catalog

Biogeme examples for Bayesian inference with the Swissmetro data¶

You find here several examples of models that illustrate how to specify models to be estimated with Biogeme using Bayesian inference. To the extent possible, we have used the same examples illustrating the maximum likelihood estimation. The names of the files should correspond too.

1a. Estimation of a logit model (Bayesian)

1a. Estimation of a logit model (Bayesian)

1b. Estimation of a logit model (Bayesian)

1b. Estimation of a logit model (Bayesian)

1c. Simulation of a logit model (traditional and Bayesian)

1c. Simulation of a logit model (traditional and Bayesian)

2. Logit and sample with weights (Bayesian)

2. Logit and sample with weights (Bayesian)

3. Moneymetric and heteroscedastic specification

3. Moneymetric and heteroscedastic specification

4. Out-of-sample validation

4. Out-of-sample validation

5. Mixture of logit models: normal distribution

5. Mixture of logit models: normal distribution

6. Mixture of logit models: uniform distribution

6. Mixture of logit models: uniform distribution

7. Latent class model

7. Latent class model

8. Box-Cox transforms

8. Box-Cox transforms

9. Nested logit model

9. Nested logit model

10. Nested logit model normalized from bottom

10. Nested logit model normalized from bottom

11. Cross-nested logit

11. Cross-nested logit

12. Mixture of logit with panel data

12. Mixture of logit with panel data

15. Discrete mixture with panel data

15. Discrete mixture with panel data

16. Latent class model with panel data

16. Latent class model with panel data

17. Mixture with lognormal distribution

17. Mixture with lognormal distribution

18a. Ordinal logit model

18a. Ordinal logit model

18. Ordinal probit model

18. Ordinal probit model

19. Calculation of individual level parameters

19. Calculation of individual level parameters

23a. Binary logit model

23a. Binary logit model

23b. Binary probit model

23b. Binary probit model

25. Triangular mixture of logit

25. Triangular mixture of logit

26. Triangular mixture with panel data

26. Triangular mixture with panel data

Data preparation for Swissmetro (binary choice)

Data preparation for Swissmetro (binary choice)

Data preparation for Swissmetro

Data preparation for Swissmetro

Panel data preparation for Swissmetro

Panel data preparation for Swissmetro

Biogeme examples for hybrid choice models¶

This directory provides example implementations of MIMIC and hybrid choice models estimated with Biogeme, using both maximum likelihood and Bayesian methods. The examples range from latent-variable-only models to fully integrated hybrid choice models and are intended as reproducible references and learning material.

Choice model

Choice model

Configuration

Configuration

Model estimation

Model estimation

Prepare for server

Prepare for server

Latent variables

Latent variables

Likert indicators

Likert indicators

MIMIC model

MIMIC model

Data preparation

Data preparation

1. Choice model only - maximum likelihood estimation

1. Choice model only - maximum likelihood estimation

2. MIMIC model - maximum likelihood estimation

2. MIMIC model - maximum likelihood estimation

3. Hybrid choice model - maximum likelihood estimation

3. Hybrid choice model - maximum likelihood estimation

4. Choice model only - Bayesian estimation

4. Choice model only - Bayesian estimation

5. MIMIC model - Bayesian estimation

5. MIMIC model - Bayesian estimation

6. Hybrid choice model - Bayesian estimation

6. Hybrid choice model - Bayesian estimation

Read or estimate model parameters

Read or estimate model parameters

Calculating indicators with Biogeme¶

Examples discussed in Bierlaire (2018) Calculating indicators with PandasBiogeme

Examples of mathematical expressions

Examples of mathematical expressions

Estimation and simulation of a nested logit model

Estimation and simulation of a nested logit model

Simulation of a choice model

Simulation of a choice model

Calculation of market shares

Calculation of market shares

Calculation of revenues

Calculation of revenues

Direct point elasticities

Direct point elasticities

Cross point elasticities

Cross point elasticities

Arc elasticities

Arc elasticities

Calculation of willingness to pay

Calculation of willingness to pay

Specification of a nested logit model

Specification of a nested logit model

Examples for the MDCEV model¶

sphx_glr_auto_examples_mdcev_no_outside_good_gamma_specification.py

File gamma_specification.py

sphx_glr_auto_examples_mdcev_no_outside_good_generalized_specification.py

File generalized_specification.py

sphx_glr_auto_examples_mdcev_no_outside_good_non_monotonic_specification.py

File non_monotonic_specification.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_gamma_estimation.py

File gamma_estimation.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_gamma_forecasting.py

File gamma_forecasting.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_generalized_estimation.py

File generalized_estimation.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_generalized_forecasting.py

File generalized_forecasting.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_non_monotonic_estimation.py

File non_monotonic_estimation.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_non_monotonic_forecasting.py

File non_monotonic_forecasting.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_translated_estimation.py

File translated_estimation.py

sphx_glr_auto_examples_mdcev_no_outside_good_plot_translated_forecasting.py

File translated_forecasting.py

sphx_glr_auto_examples_mdcev_no_outside_good_process_data.py

File process_data.py

Specification of the baseline utilities of a MDCEV model.

Specification of the baseline utilities of a MDCEV model.

sphx_glr_auto_examples_mdcev_no_outside_good_translated_specification.py

File translated_specification.py

Monte-Carlo integration with Biogeme¶

Example discussed in Bierlaire (2019) Monte-Carlo integration with Biogeme

Specification of the mixtures of logit

Specification of the mixtures of logit

Simple integral

Simple integral

Various integration methods

Various integration methods

Antithetic draws

Antithetic draws

Antithetic draws explicitly generated

Antithetic draws explicitly generated

Numerical integration

Numerical integration

Monte-Carlo integration

Monte-Carlo integration

Estimation of mixtures of logit

Estimation of mixtures of logit

Mixtures of logit with Monte-Carlo 10_000 draws

Mixtures of logit with Monte-Carlo 10_000 draws

Mixtures of logit with Monte-Carlo 500 draws

Mixtures of logit with Monte-Carlo 500 draws

Mixtures of logit with Monte-Carlo 10_000 antithetic draws

Mixtures of logit with Monte-Carlo 10_000 antithetic draws

Mixtures of logit with Monte-Carlo 500 antithetic draws

Mixtures of logit with Monte-Carlo 500 antithetic draws

Mixtures of logit with Monte-Carlo 10_000 Halton draws

Mixtures of logit with Monte-Carlo 10_000 Halton draws

Mixtures of logit with Monte-Carlo 500 Halton draws

Mixtures of logit with Monte-Carlo 500 Halton draws

Mixtures of logit with Monte-Carlo 10_000 MLHS draws

Mixtures of logit with Monte-Carlo 10_000 MLHS draws

Mixtures of logit with Monte-Carlo 500 MLHS draws

Mixtures of logit with Monte-Carlo 500 MLHS draws

Mixtures of logit with Monte-Carlo 10_000 antithetic MLHS draws

Mixtures of logit with Monte-Carlo 10_000 antithetic MLHS draws

Mixtures of logit with Monte-Carlo 2000 antithetic MLHS draws

Mixtures of logit with Monte-Carlo 2000 antithetic MLHS draws

Data preparation for Swissmetro

Data preparation for Swissmetro

Data preparation for Swissmetro: one observation

Data preparation for Swissmetro: one observation

Programming with Biogeme¶

Examples of the use of various Biogeme objects for programming.

biogeme.biogeme

biogeme.biogeme

biogeme.biogeme_logging

biogeme.biogeme_logging

biogeme.cnl

biogeme.cnl

biogeme.database

biogeme.database

biogeme.distributions

biogeme.distributions

biogeme.draws

biogeme.draws

biogeme.expressions

biogeme.expressions

biogeme.filenames

biogeme.filenames

biogeme.loglikelihood

biogeme.loglikelihood

biogeme.models

biogeme.models

biogeme.nests

biogeme.nests

biogeme.optimization

biogeme.optimization

biogeme.results_processing

biogeme.results_processing

biogeme.segmentation

biogeme.segmentation

biogeme.tools

biogeme.tools

biogeme.version

biogeme.version

Sampling of alternatives¶

Examples discussed in Bierlaire and Paschalidis (2023) Estimating MEV models with samples of alternatives

List of alternatives

List of alternatives

Compare parameters

Compare parameters

Logit

Logit

Nested logit

Nested logit

Cross-nested logit

Cross-nested logit

Model specification

Model specification

Model specification

Model specification

True parameters

True parameters

Biogeme examples for the Swissmetro data¶

You find here several examples of models that can be estimated and simulated with Biogeme.

sphx_glr_auto_examples_swissmetro_generate_jed_run.py

Generate SLURM run scripts for Biogeme experiments.

1a. Estimation of a logit model

1a. Estimation of a logit model

1b. Illustration of additional features of Biogeme

1b. Illustration of additional features of Biogeme

1c. Illustration of the quick_estimate of Biogeme

1c. Illustration of the quick_estimate of Biogeme

1d. Simulation of a logit model

1d. Simulation of a logit model

1e. Logit model with several algorithms

1e. Logit model with several algorithms

2. Estimation with weights: WESML

2. Estimation with weights: WESML

3. Moneymetric and heteroscedastic specification

3. Moneymetric and heteroscedastic specification

4. Out-of-sample validation

4. Out-of-sample validation

5a. Mixture of logit models with Monte-Carlo integration

5a. Mixture of logit models with Monte-Carlo integration

5b. Mixture of logit models with numerical integration

5b. Mixture of logit models with numerical integration

5c. Simulation of a mixture model

5c. Simulation of a mixture model

Mixture of logit

Mixture of logit

6a. Mixture of logit models with uniform distribution

6a. Mixture of logit models with uniform distribution

6b. Mixture of logit models with uniform MLHS draws

6b. Mixture of logit models with uniform MLHS draws

sphx_glr_auto_examples_swissmetro_plot_b06c_unif_mixture_integral.py

"

7. Latent class model

7. Latent class model

8. Box-Cox transforms

8. Box-Cox transforms

9. Nested logit model

9. Nested logit model

10. Nested logit model normalized from bottom

10. Nested logit model normalized from bottom

11a. Cross-nested logit

11a. Cross-nested logit

11b. Simulation of a cross-nested logit model

11b. Simulation of a cross-nested logit model

11c. Cross-nested logit with a sparse structure

11c. Cross-nested logit with a sparse structure

12. Mixture of logit with panel data

12. Mixture of logit with panel data

13. Simulation of panel model

13. Simulation of panel model

14. Nested logit with corrections for endogeneous sampling

14. Nested logit with corrections for endogeneous sampling

15a. Discrete mixture with panel data

15a. Discrete mixture with panel data

15b. Discrete mixture with panel data

15b. Discrete mixture with panel data

16. Discrete mixture with panel data

16. Discrete mixture with panel data

17a. Mixture with lognormal distribution

17a. Mixture with lognormal distribution

17b. Mixture with lognormal distribution and numerical integration

17b. Mixture with lognormal distribution and numerical integration

18a. Ordinal logit model

18a. Ordinal logit model

18b. Ordinal probit model

18b. Ordinal probit model

19. Calculation of individual level parameters

19. Calculation of individual level parameters

20. Estimation of several models

20. Estimation of several models

21a. Assisted specification

21a. Assisted specification

21b. Specification of a catalog of models

21b. Specification of a catalog of models

21c. Re-estimate the Pareto optimal models

21c. Re-estimate the Pareto optimal models

Assisted specification

Assisted specification

Specification of a catalog of models

Specification of a catalog of models

Re-estimate the Pareto optimal models

Re-estimate the Pareto optimal models

23a. Binary logit model

23a. Binary logit model

23b. Binary probit model

23b. Binary probit model

24. Mixture of logit with Halton draws

24. Mixture of logit with Halton draws

25. Triangular mixture of logit

25. Triangular mixture of logit

26. Triangular mixture with panel data

26. Triangular mixture with panel data

Data preparation for Swissmetro (binary choice)

Data preparation for Swissmetro (binary choice)

Data preparation for Swissmetro

Data preparation for Swissmetro

Panel data preparation for Swissmetro

Panel data preparation for Swissmetro

Timing function evaluation¶

We perform here the timing on some functions. The results clearly depend on the computer where it is run.

Timing of a logit model

Timing of a logit model

Timing of a cross-nested logit model

Timing of a cross-nested logit model

Timing of a logit model

Timing of a logit model

Comparison of execution times

Comparison of execution times

Data preparation for Swissmetro

Data preparation for Swissmetro

Tool for timing an expression

Tool for timing an expression

Timing of any expression

Timing of any expression

Some simple examples for beginners¶

Estimation of a binary logit model

Estimation of a binary logit model

Configuring Biogeme with parameters

Configuring Biogeme with parameters

Importing model specification

Importing model specification

Estimation results

Estimation results

Using the estimated model

Using the estimated model

Data definition for the simple tutorial

Data definition for the simple tutorial

Model specification for the simple tutorial

Model specification for the simple tutorial

Download all examples in Python source code: auto_examples_python.zip

Download all examples in Jupyter notebooks: auto_examples_jupyter.zip

Gallery generated by Sphinx-Gallery

Copyright © 2025, Michel Bierlaire
Made with Sphinx and @pradyunsg's Furo
On this page
  • Gallery of examples
    • Assisted specification with Biogeme
    • Biogeme examples for Bayesian inference with the Swissmetro data
    • Biogeme examples for hybrid choice models
    • Calculating indicators with Biogeme
    • Examples for the MDCEV model
    • Monte-Carlo integration with Biogeme
    • Programming with Biogeme
    • Sampling of alternatives
    • Biogeme examples for the Swissmetro data
    • Timing function evaluation
    • Some simple examples for beginners