Gallery of examples¶
Assisted specification with Biogeme¶
Examples discussed in Bierlaire and Ortelli (2023) Assisted Specification with Biogeme 3.2.12
The example 10. Controlling a generated parameter for a missing segmentation category reproduces a common missing
category problem. A has_pt_subscr segmentation contains one -99
observation, represented in the segmentation as minus_99, and the
automatically generated coefficients for that category are fixed to zero in
every catalog alternative before estimation.
Combine many specifications: assisted specification algorithm
10. Controlling a generated parameter for a missing segmentation category
Segmentations and alternative specific specification
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.
1c. Simulation of a logit model (traditional and Bayesian)
1b. Estimation of a logit model with custom priors (Bayesian)
Hybrid choice models¶
Examples of discrete choice models with latent variables.
Technical report¶
The examples are described in the technical report Estimating hybrid choice models with Biogeme, by Michel Bierlaire, Moshe Ben-Akiva, and Joan Walker (Report TRANSP-OR 260814).
The build-only example 8. Build-only hybrid-choice example with explicit parameter overrides shows how to override a parameter created automatically by the latent-variable builder. It follows the simultaneous Gaussian model, applies a fixed measurement loading, and stops before estimation so that the documentation focuses on expression construction.
Baseline mode choice model: maximum likelihood estimation
Sequential estimation of a choice model with a latent variable
Gaussian MIMIC model: maximum likelihood estimation
8. Build-only hybrid-choice example with explicit parameter overrides
Gaussian hybrid mode choice model: simultaneous maximum likelihood estimation
Ordered-logit hybrid mode choice model: simultaneous maximum likelihood estimation
Ordered-probit hybrid mode choice model: simultaneous maximum likelihood estimation
Simultaneous hybrid choice model with ordered-probit indicators
Hybrid choice models specifications¶
Examples of specifications of discrete choice models with latent variables. No estimation is performed.
Generate files from latent-variable measurement specifications
Resolve latent-variable measurement specifications
Calculating indicators with Biogeme¶
Examples discussed in Bierlaire (2018) Calculating indicators with PandasBiogeme
Examples for the MDCEV model¶
Monte-Carlo integration with Biogeme¶
Example discussed in Bierlaire (2019) Monte-Carlo integration with Biogeme
Mixtures of logit with Monte-Carlo 10_000 MLHS 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 antithetic MLHS draws
Mixtures of logit with Monte-Carlo 2000 antithetic MLHS draws
Programming with Biogeme¶
Examples of the use of various Biogeme objects for programming.
Sampling of alternatives¶
Examples discussed in Bierlaire and Paschalidis (2023) Estimating MEV models with samples of alternatives
Biogeme examples for the Swissmetro data¶
You find here several examples of models that can be estimated and simulated with Biogeme.
The example 28. Explicit parameter overrides in a simple model introduces explicit parameter
overrides. It shows how to replace a Beta by a fixed Beta or by a
numeric expression before constructing the BIOGEME object.
The example 27. Post-estimation Monte Carlo draw-stability diagnostic illustrates the post-estimation Monte Carlo draw-stability diagnostic. It evaluates the objective and gradient at the fixed estimates with fresh draw designs of increasing size. The diagnostic can be interrupted and resumed; it writes a raw YAML checkpoint and an American-English Markdown report separately from the ordinary estimation result.
28. Explicit parameter overrides in a simple model
1c. Illustration of the quick_estimate method in Biogeme
17b. Mixture with lognormal distribution and numerical integration
6b. Mixture of logit models with uniform MLHS draws
6a. Mixture of logit models with uniform distribution
5b. Mixture of logit models with numerical integration
5a. Mixture of logit models with Monte-Carlo integration
6c. Mixture of logit models with uniform distribution and numerical integration
14. Nested logit with corrections for endogeneous sampling
12bis. Mixture of logit with panel data and segmented ASC
27. Post-estimation Monte Carlo draw-stability diagnostic
Timing function evaluation¶
We perform here the timing on some functions. The results clearly depend on the computer where it is run.