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.1 documentation
Biogeme 3.3.1 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
      • Estimation of a logit model
      • Logit model
      • Illustration of additional features of Biogeme
      • Simulation of a logit model
      • Illustration the quick_estimate of Biogeme
      • WESML
      • Heteroscedastic specification
      • Out-of-sample validation
      • Mixture of logit models
      • Mixture of logit
      • Mixture of logit models
      • Simulation of a mixture model
      • Mixture of logit models
      • Mixture of logit models
      • Mixture of logit models
      • Latent class model
      • Box-Cox transforms
      • Nested logit model
      • Nested logit model normalized from bottom
      • Cross-nested logit
      • Cross-nested logit
      • Simulation of a cross-nested logit model
      • Cross-nested logit
      • Mixture of logit with panel data
      • Simulation of panel model
      • Nested logit with corrections for endogeneous sampling
      • Discrete mixture with panel data
      • Discrete mixture with panel data
      • Discrete mixture with panel data
      • Mixture with lognormal distribution
      • Mixture with lognormal distribution
      • Ordinal logit model
      • Ordinal probit model
      • Calculation of individual level parameters
      • Estimation of several models
      • Assisted specification
      • Specification of a catalog of models
      • Re-estimate the Pareto optimal models
      • Assisted specification
      • Specification of a catalog of models
      • Re-estimate the Pareto optimal models
      • Binary logit model
      • Binary probit model
      • Mixture of logit with Halton draws
      • Triangular mixture of logit
      • 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
      • Specification of the choice model
      • Likelihood function
      • Specification of the continuous measurement equations
      • Specification of the discrete measurement equations
      • Data preparation for Optima
      • MIMIC (Multiple Indicators Multiple Causes) model
      • Estimation of the choice model
      • Estimation of the hybrid choice model
      • Read of estimate
      • Relevant data for the hybrid choice model
      • Specification of the structural equations
    • 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.biogeme module
    • biogeme.biogeme_logging module
    • biogeme.calculator module
      • biogeme.calculator.function_call module
      • biogeme.calculator.hessian_calculation module
      • biogeme.calculator.multiple_formula module
      • biogeme.calculator.simple_formula module
      • biogeme.calculator.single_formula 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.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.exceptions module
    • biogeme.expressions module
      • biogeme.expressions.add_prefix_suffix module
      • biogeme.expressions.audit module
      • biogeme.expressions.base_expressions 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.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.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.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.panel_likelihood_trajectory module
      • biogeme.expressions.plus module
      • biogeme.expressions.power module
      • biogeme.expressions.power_constant module
      • biogeme.expressions.random_variable module
      • biogeme.expressions.rename_variables 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.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.model_elements module
    • biogeme.models module
      • biogeme.models.boxcox 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.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.likelihood_ratio module
      • biogeme.tools.primes module
      • biogeme.tools.serialize_numpy module
      • biogeme.tools.simulate module
      • biogeme.tools.time module
      • biogeme.tools.unique_ids 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

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

Biogeme examples for hybrid choice models¶

You find here an example of choice models with latent variables.

Specification of the choice model

Specification of the choice model

Likelihood function

Likelihood function

Specification of the continuous measurement equations

Specification of the continuous measurement equations

Specification of the discrete measurement equations

Specification of the discrete measurement equations

Data preparation for Optima

Data preparation for Optima

MIMIC (Multiple Indicators Multiple Causes) model

MIMIC (Multiple Indicators Multiple Causes) model

Estimation of the choice model

Estimation of the choice model

Estimation of the hybrid choice model

Estimation of the hybrid choice model

Read of estimate

Read of estimate

Relevant data for the hybrid choice model

Relevant data for the hybrid choice model

Specification of the structural equations

Specification of the structural equations

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.

Estimation of a logit model

Estimation of a logit model

Logit model

Logit model

Illustration of additional features of Biogeme

Illustration of additional features of Biogeme

Simulation of a logit model

Simulation of a logit model

Illustration the quick_estimate of Biogeme

Illustration the quick_estimate of Biogeme

WESML

WESML

Heteroscedastic specification

Heteroscedastic specification

Out-of-sample validation

Out-of-sample validation

Mixture of logit models

Mixture of logit models

Mixture of logit

Mixture of logit

Mixture of logit models

Mixture of logit models

Simulation of a mixture model

Simulation of a mixture model

Mixture of logit models

Mixture of logit models

Mixture of logit models

Mixture of logit models

sphx_glr_auto_examples_swissmetro_plot_b06unif_mixture_integral.py

"

Latent class model

Latent class model

Box-Cox transforms

Box-Cox transforms

Nested logit model

Nested logit model

Nested logit model normalized from bottom

Nested logit model normalized from bottom

Cross-nested logit

Cross-nested logit

Cross-nested logit

Cross-nested logit

Simulation of a cross-nested logit model

Simulation of a cross-nested logit model

Cross-nested logit

Cross-nested logit

Mixture of logit with panel data

Mixture of logit with panel data

Simulation of panel model

Simulation of panel model

Nested logit with corrections for endogeneous sampling

Nested logit with corrections for endogeneous sampling

Discrete mixture with panel data

Discrete mixture with panel data

Discrete mixture with panel data

Discrete mixture with panel data

Discrete mixture with panel data

Discrete mixture with panel data

Mixture with lognormal distribution

Mixture with lognormal distribution

Mixture with lognormal distribution

Mixture with lognormal distribution

Ordinal logit model

Ordinal logit model

Ordinal probit model

Ordinal probit model

Calculation of individual level parameters

Calculation of individual level parameters

Estimation of several models

Estimation of several 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

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

Binary logit model

Binary logit model

Binary probit model

Binary probit model

Mixture of logit with Halton draws

Mixture of logit with Halton draws

Triangular mixture of logit

Triangular mixture of logit

Triangular mixture with panel data

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
    • Calculating indicators with Biogeme
    • Biogeme examples for hybrid choice models
    • 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