.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/montecarlo/plot_b07estimation_monte_carlo_mlhs_anti_500.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_montecarlo_plot_b07estimation_monte_carlo_mlhs_anti_500.py: Mixtures of logit with Monte-Carlo 2000 antithetic MLHS draws ============================================================= Estimation of a mixtures of logit models where the integral is approximated using MonteCarlo integration with antithetic MLHS draws. Michel Bierlaire, EPFL Sun Jun 29 2025, 02:12:06 .. GENERATED FROM PYTHON SOURCE LINES 12-23 .. code-block:: Python from b07estimation_specification import get_biogeme from IPython.core.display_functions import display import biogeme.biogeme_logging as blog from biogeme.expressions import Draws from biogeme.results_processing import ( EstimationResults, get_pandas_estimated_parameters, ) .. GENERATED FROM PYTHON SOURCE LINES 24-27 .. code-block:: Python logger = blog.get_screen_logger(level=blog.INFO) logger.info('Example b07estimation_specification_mlhs_anti_500.py') .. rst-class:: sphx-glr-script-out .. code-block:: none Example b07estimation_specification_mlhs_anti_500.py .. GENERATED FROM PYTHON SOURCE LINES 28-34 .. code-block:: Python R = 500 the_draws = Draws('b_time_rnd', 'NORMAL_MLHS_ANTI') the_biogeme = get_biogeme(the_draws=the_draws, number_of_draws=R) the_biogeme.model_name = 'b07estimation_monte_carlo_mlhs_anti_500' results_file = f'saved_results/{the_biogeme.model_name}.yaml' .. rst-class:: sphx-glr-script-out .. code-block:: none Biogeme parameters read from biogeme.toml. .. GENERATED FROM PYTHON SOURCE LINES 35-39 .. code-block:: Python try: results = EstimationResults.from_yaml_file(filename=results_file) except FileNotFoundError: results = the_biogeme.estimate() .. GENERATED FROM PYTHON SOURCE LINES 40-42 .. code-block:: Python print(results.short_summary()) .. rst-class:: sphx-glr-script-out .. code-block:: none Results for model b07estimation_monte_carlo_mlhs_anti_500 Nbr of parameters: 5 Sample size: 10719 Excluded data: 9 Final log likelihood: -8571.075 Akaike Information Criterion: 17152.15 Bayesian Information Criterion: 17188.55 .. GENERATED FROM PYTHON SOURCE LINES 43-44 Get the results in a pandas table .. GENERATED FROM PYTHON SOURCE LINES 44-48 .. code-block:: Python pandas_results = get_pandas_estimated_parameters( estimation_results=results, ) display(pandas_results) .. rst-class:: sphx-glr-script-out .. code-block:: none Name Value Robust std err. Robust t-stat. Robust p-value 0 asc_train -0.467507 0.047871 -9.765937 0.000000e+00 1 b_time -1.853896 0.074861 -24.764486 0.000000e+00 2 b_time_s 1.187287 0.083763 14.174419 0.000000e+00 3 b_cost -0.844771 0.057556 -14.677359 0.000000e+00 4 asc_car 0.178497 0.035058 5.091511 3.552214e-07 .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.257 seconds) .. _sphx_glr_download_auto_examples_montecarlo_plot_b07estimation_monte_carlo_mlhs_anti_500.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_b07estimation_monte_carlo_mlhs_anti_500.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_b07estimation_monte_carlo_mlhs_anti_500.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_b07estimation_monte_carlo_mlhs_anti_500.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_