3. Hybrid choice model - maximum likelihood estimationΒΆ

This script estimates a hybrid choice model that combines:

  • a discrete choice model, and

  • a MIMIC model with two latent variables (structural and measurement equations),

using maximum likelihood estimation in Biogeme.

It represents the full model specification, bringing together the choice component and the latent-variable component, and can be compared against:

  • the choice-only model, and

  • the MIMIC-only model,

to assess the contribution of latent variables to model performance.

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:25:28

Biogeme parameters read from biogeme.toml.
Results are read from the file saved_results/b03_hybrid_ml.yaml.
Results for model b03_hybrid_ml
Nbr of parameters:              75
Sample size:                    896
Excluded data:                  0
Final log likelihood:           -17432.33
Akaike Information Criterion:   35014.65
Bayesian Information Criterion: 35374.5

                                                 Name  ...  BHHH p-value
0                                       choice_asc_pt  ...  3.733223e-03
1                             choice_beta_time_pt_ref  ...  6.241729e-05
2                     beta_time_pt_lambda_environment  ...  4.461713e-02
3           struct_environmental_attitude_childSuburb  ...  9.226889e-03
4          struct_environmental_attitude_ScaledIncome  ...  1.601028e-04
..                                                ...  ...           ...
70                      measurement_Envir02_sigma_log  ...  5.978541e-07
71                        measurement_intercept_NbCar  ...  0.000000e+00
72  measurement_coefficient_car_centric_attitude_N...  ...  2.449507e-11
73                                   cars_delta_1_log  ...  0.000000e+00
74                                   cars_delta_2_log  ...  0.000000e+00

[75 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)

the_config = Config(
    name='b03_hybrid_ml',
    latent_variables="two",
    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 1.079 seconds)

Gallery generated by Sphinx-Gallery