.. 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.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.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. :author: Michel Bierlaire, EPFL :date: Thu Apr 13 23:38:58 2023 .. GENERATED FROM PYTHON SOURCE LINES 12-17 .. code-block:: default import biogeme.biogeme_logging as blog from biogeme.expressions import bioDraws from b07estimation_specification import get_biogeme .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: default logger = blog.get_screen_logger(level=blog.INFO) logger.info('Example b07estimation_specification_mlhs_anti.py') .. rst-class:: sphx-glr-script-out .. code-block:: none Example b07estimation_specification_mlhs_anti.py .. GENERATED FROM PYTHON SOURCE LINES 22-24 .. code-block:: default R = 2000 .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: default the_draws = bioDraws('B_TIME_RND', 'NORMAL_MLHS_ANTI') the_biogeme = get_biogeme(the_draws=the_draws, number_of_draws=R) the_biogeme.modelName = 'b07estimation_monte_carlo_mlhs_anti' .. rst-class:: sphx-glr-script-out .. code-block:: none File /var/folders/rp/ppksq7xd6_x7p0jb0t73x7vw0000gq/T/tmp_a3zlk2w/117e337a-40fb-4cd9-b81f-2807d677101e has been parsed. .. GENERATED FROM PYTHON SOURCE LINES 30-32 .. code-block:: default results = the_biogeme.estimate() .. rst-class:: sphx-glr-script-out .. code-block:: none *** Initial values of the parameters are obtained from the file __b07estimation_monte_carlo_mlhs_anti.iter Parameter values restored from __b07estimation_monte_carlo_mlhs_anti.iter Optimization algorithm: hybrid Newton/BFGS with simple bounds [simple_bounds] ** Optimization: Newton with trust region for simple bounds Iter. asc_car asc_train b_cost b_time b_time_s Function Relgrad Radius Rho 0 -0.082 -0.8 -0.32 -1 0.87 5.4e+03 0.046 10 1 ++ 1 0.018 -0.56 -0.99 -1.6 0.93 5.2e+03 0.009 1e+02 1.1 ++ 2 0.1 -0.42 -1.2 -2.1 1.4 5.2e+03 0.0053 1e+03 1.1 ++ 3 0.13 -0.4 -1.3 -2.2 1.6 5.2e+03 0.00079 1e+04 1.1 ++ 4 0.14 -0.4 -1.3 -2.3 1.7 5.2e+03 1.5e-05 1e+05 1 ++ 5 0.14 -0.4 -1.3 -2.3 1.7 5.2e+03 4.6e-09 1e+05 1 ++ .. GENERATED FROM PYTHON SOURCE LINES 33-35 .. code-block:: default print(results.shortSummary()) .. rst-class:: sphx-glr-script-out .. code-block:: none The syntax "shortSummary" is deprecated and is replaced by the syntax "short_summary". Results for model b07estimation_monte_carlo_mlhs_anti Nbr of parameters: 5 Sample size: 6768 Excluded data: 3960 Final log likelihood: -5215.033 Akaike Information Criterion: 10440.07 Bayesian Information Criterion: 10474.17 .. GENERATED FROM PYTHON SOURCE LINES 36-38 .. code-block:: default pandas_results = results.getEstimatedParameters() pandas_results .. raw:: html
Value Rob. Std err Rob. t-test Rob. p-value
asc_car 0.136686 0.051675 2.645110 8.166426e-03
asc_train -0.401673 0.065805 -6.103988 1.034538e-09
b_cost -1.284093 0.086314 -14.876988 0.000000e+00
b_time -2.258465 0.116803 -19.335631 0.000000e+00
b_time_s 1.654370 0.129659 12.759368 0.000000e+00


.. rst-class:: sphx-glr-timing **Total running time of the script:** (4 minutes 52.683 seconds) .. _sphx_glr_download_auto_examples_montecarlo_plot_b07estimation_monte_carlo_mlhs_anti.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_b07estimation_monte_carlo_mlhs_anti.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_b07estimation_monte_carlo_mlhs_anti.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_