Note
Go to the end to download the full example code.
1. Choice model only - maximum likelihood estimationΒΆ
This script runs a standard discrete choice model without any latent variables, estimated by maximum likelihood using Biogeme.
It serves as a baseline specification against which hybrid choice models (with latent variables and measurement equations) can be compared.
The configuration is defined locally in this file and passed to the generic
estimation pipeline via estimate_model().
Michel Bierlaire Thu Dec 25 2025, 08:24:06
Default values of the Biogeme parameters are used.
File biogeme.toml has been created
Results are read from the file saved_results/b01_choice_only_ml.yaml.
Results for model b01_choice_only_ml
Nbr of parameters: 7
Sample size: 896
Excluded data: 0
Final log likelihood: -512.5193
Akaike Information Criterion: 1039.039
Bayesian Information Criterion: 1072.624
Name Value ... BHHH t-stat. BHHH p-value
0 choice_asc_pt -0.665118 ... -2.401766 0.016316
1 choice_beta_time_pt_ref -0.955522 ... -8.439265 0.000000
2 choice_beta_cost -0.079532 ... -9.546250 0.000000
3 choice_asc_car -0.246145 ... -1.065900 0.286469
4 choice_beta_time_car_ref -2.033204 ... -13.104580 0.000000
5 choice_beta_dist_work -0.204695 ... -13.801076 0.000000
6 choice_beta_dist_other_purposes -0.323970 ... -10.584442 0.000000
[7 rows x 5 columns]
import biogeme.biogeme_logging as blog
from config import Config
from estimate import estimate_model
logger = blog.get_screen_logger(level=blog.INFO)
# Choice model only
the_config = Config(
name='b01_choice_only_ml',
latent_variables="zero",
choice_model="yes",
estimation="ml",
number_of_bayesian_draws_per_chain=20_000,
number_of_monte_carlo_draws=20_000,
)
estimate_model(config=the_config)
Total running time of the script: (0 minutes 0.834 seconds)