.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/hybrid_choice/plot_b03_hybrid_ml.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_hybrid_choice_plot_b03_hybrid_ml.py: 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 :func:`estimate_model`. Michel Bierlaire Thu Dec 25 2025, 08:25:28 .. GENERATED FROM PYTHON SOURCE LINES 26-44 .. rst-class:: sphx-glr-script-out .. code-block:: none 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] | .. code-block:: Python 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) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.079 seconds) .. _sphx_glr_download_auto_examples_hybrid_choice_plot_b03_hybrid_ml.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_b03_hybrid_ml.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_b03_hybrid_ml.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_b03_hybrid_ml.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_