.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/assisted/plot_b08selected_specification.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_assisted_plot_b08selected_specification.py: One model among many ==================== We consider the model with 432 specifications defined in :ref:`everything_spec_section`. We select one specification and estimate it. See `Bierlaire and Ortelli (2023) `_. :author: Michel Bierlaire, EPFL :date: Sat Jul 15 15:46:56 2023 .. GENERATED FROM PYTHON SOURCE LINES 15-21 .. code-block:: default import biogeme.biogeme_logging as blog import biogeme.biogeme as bio from everything_spec import model_catalog, database, av logger = blog.get_screen_logger(level=blog.INFO) .. GENERATED FROM PYTHON SOURCE LINES 22-25 The code characterizing the specification should be copied from the .pareto file generated by the algorithm, or from one of the glossaries illustrated in earlier examples. .. GENERATED FROM PYTHON SOURCE LINES 25-34 .. code-block:: default SPEC_ID = ( 'ASC:GA-LUGGAGE;' 'B_COST_gen_altspec:generic;' 'B_TIME:FIRST;' 'B_TIME_gen_altspec:generic;' 'model_catalog:logit;' 'train_tt_catalog:power' ) .. GENERATED FROM PYTHON SOURCE LINES 35-36 the spec_id, and used as usual. .. GENERATED FROM PYTHON SOURCE LINES 36-43 .. code-block:: default the_biogeme = bio.BIOGEME.from_configuration( config_id=SPEC_ID, expression=model_catalog, database=database, ) the_biogeme.modelName = 'my_favorite_model' .. rst-class:: sphx-glr-script-out .. code-block:: none File biogeme.toml has been parsed. .. GENERATED FROM PYTHON SOURCE LINES 44-45 Calculate of the null log-likelihood for reporting. .. GENERATED FROM PYTHON SOURCE LINES 45-47 .. code-block:: default the_biogeme.calculateNullLoglikelihood(av) .. rst-class:: sphx-glr-script-out .. code-block:: none -6964.662979191462 .. GENERATED FROM PYTHON SOURCE LINES 48-49 Estimate the parameters. .. GENERATED FROM PYTHON SOURCE LINES 49-51 .. 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 __my_favorite_model.iter Cannot read file __my_favorite_model.iter. Statement is ignored. Optimization algorithm: hybrid Newton/BFGS with simple bounds [simple_bounds] ** Optimization: Newton with trust region for simple bounds Iter. ASC_CAR ASC_CAR_GA ASC_CAR_one_lug ASC_CAR_several ASC_TRAIN ASC_TRAIN_GA ASC_TRAIN_one_l ASC_TRAIN_sever B_COST B_TIME B_TIME_1st_clas cube_tt_coef square_tt_coef Function Relgrad Radius Rho 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7e+03 0.27 0.5 -1.7 - 1 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 5 1.1 ++ 2 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 2.5 -9.2 - 3 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 1.2 -8.9 - 4 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.62 -8.5 - 5 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.31 -5.6 - 6 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.16 -3.2 - 7 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.078 -2.7 - 8 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.039 -2.7 - 9 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.02 -3 - 10 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.0098 -3.2 - 11 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.0049 -3.4 - 12 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.0024 -2.2 - 13 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.0012 -1.5 - 14 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.00061 -0.8 - 15 -0.068 -0.065 -0.064 -0.0096 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 0 0 5.6e+03 8 0.00031 -0.045 - 16 -0.068 -0.066 -0.064 -0.0099 -0.5 0.024 -0.5 -0.026 -0.15 -0.5 -0.5 -0.00031 0.00031 5.6e+03 3 0.00031 0.7 + 17 -0.068 -0.066 -0.064 -0.0099 -0.5 0.025 -0.5 -0.026 -0.15 -0.5 -0.5 -0.00026 0.00061 5.6e+03 1 0.00031 0.87 + 18 -0.068 -0.066 -0.064 -0.0099 -0.5 0.025 -0.5 -0.026 -0.16 -0.5 -0.5 -0.00027 0.00092 5.6e+03 0.069 0.0031 1 ++ 19 -0.068 -0.066 -0.065 -0.01 -0.5 0.026 -0.5 -0.026 -0.16 -0.5 -0.5 -0.00023 0.004 5.6e+03 4.5 0.031 1 ++ 20 -0.069 -0.072 -0.069 -0.011 -0.51 0.043 -0.49 -0.027 -0.19 -0.52 -0.51 -0.00043 0.034 5.5e+03 1.5 0.31 0.99 ++ 21 -0.048 -0.13 -0.097 -0.02 -0.56 0.23 -0.34 -0.03 -0.49 -0.63 -0.6 -0.001 0.18 5.4e+03 1.2 3.1 0.98 ++ 22 -0.048 -0.13 -0.097 -0.02 -0.56 0.23 -0.34 -0.03 -0.49 -0.63 -0.6 -0.001 0.18 5.4e+03 1.2 1.5 -19 - 23 -0.048 -0.13 -0.097 -0.02 -0.56 0.23 -0.34 -0.03 -0.49 -0.63 -0.6 -0.001 0.18 5.4e+03 1.2 0.76 -2.6 - 24 0.027 -0.3 -0.14 -0.053 -0.75 0.87 0.12 -0.037 -1.3 -0.92 -0.82 0.00035 -0.14 5.2e+03 11 0.76 0.31 + 25 0.044 -0.32 -0.061 -0.081 -0.84 1.2 0.32 -0.026 -1.2 -1.7 -1.2 -0.00012 -0.029 5.1e+03 10 0.76 0.35 + 26 0.044 -0.32 -0.061 -0.081 -0.84 1.2 0.32 -0.026 -1.2 -1.7 -1.2 -0.00012 -0.029 5.1e+03 10 0.38 -4.1 - 27 0.044 -0.32 -0.061 -0.081 -0.84 1.2 0.32 -0.026 -1.2 -1.7 -1.2 -0.00012 -0.029 5.1e+03 10 0.19 -1.5 - 28 0.044 -0.32 -0.061 -0.081 -0.84 1.2 0.32 -0.026 -1.2 -1.7 -1.2 -0.00012 -0.029 5.1e+03 10 0.095 -0.45 - 29 0.049 -0.32 -0.058 -0.081 -0.83 1.2 0.32 -0.026 -1.2 -1.7 -1.2 0.00026 -0.12 5e+03 32 0.095 0.71 + 30 0.085 -0.33 -0.037 -0.09 -0.93 1.3 0.31 -0.022 -1.2 -1.7 -1.2 0.00022 -0.11 4.9e+03 5.2 0.95 0.96 ++ 31 -0.054 -0.27 -0.015 -0.37 -1.4 1.8 0.62 0.29 -1.2 -1.7 -0.85 0.00021 -0.11 4.9e+03 1.4 9.5 1 ++ 32 -0.055 -0.27 -0.0067 -0.45 -1.5 1.8 0.65 0.41 -1.2 -1.7 -0.87 0.00022 -0.11 4.9e+03 0.12 95 1 ++ 33 -0.056 -0.27 -0.0065 -0.45 -1.5 1.8 0.65 0.41 -1.2 -1.7 -0.87 0.00022 -0.11 4.9e+03 0.00038 9.5e+02 1 ++ 34 -0.055 -0.27 -0.0066 -0.45 -1.5 1.8 0.65 0.41 -1.2 -1.7 -0.87 0.00022 -0.11 4.9e+03 9e-06 9.5e+03 1 ++ 35 -0.055 -0.27 -0.0066 -0.45 -1.5 1.8 0.65 0.41 -1.2 -1.7 -0.87 0.00022 -0.11 4.9e+03 3.1e-08 9.5e+03 1 ++ .. GENERATED FROM PYTHON SOURCE LINES 52-54 .. code-block:: default print(results.short_summary()) .. rst-class:: sphx-glr-script-out .. code-block:: none Results for model my_favorite_model Nbr of parameters: 13 Sample size: 6768 Excluded data: 3960 Null log likelihood: -6964.663 Final log likelihood: -4893.276 Likelihood ratio test (null): 4142.773 Rho square (null): 0.297 Rho bar square (null): 0.296 Akaike Information Criterion: 9812.552 Bayesian Information Criterion: 9901.212 .. GENERATED FROM PYTHON SOURCE LINES 55-56 Get the results in a pandas table .. GENERATED FROM PYTHON SOURCE LINES 56-58 .. code-block:: default pandas_results = results.getEstimatedParameters() .. GENERATED FROM PYTHON SOURCE LINES 59-60 .. code-block:: default pandas_results .. raw:: html
Value Rob. Std err Rob. t-test Rob. p-value
ASC_CAR -0.055460 0.061063 -0.908233 3.637550e-01
ASC_CAR_GA -0.266741 0.199211 -1.338988 1.805746e-01
ASC_CAR_one_lugg -0.006600 0.067934 -0.097149 9.226082e-01
ASC_CAR_several_lugg -0.451146 0.238481 -1.891745 5.852494e-02
ASC_TRAIN -1.459784 0.098129 -14.876203 0.000000e+00
ASC_TRAIN_GA 1.770124 0.092217 19.195267 0.000000e+00
ASC_TRAIN_one_lugg 0.650824 0.099752 6.524433 6.825940e-11
ASC_TRAIN_several_lugg 0.407875 0.217169 1.878149 6.036073e-02
B_COST -1.216618 0.082664 -14.717573 0.000000e+00
B_TIME -1.700332 0.127474 -13.338634 0.000000e+00
B_TIME_1st_class -0.873606 0.118374 -7.380072 1.580958e-13
cube_tt_coef 0.000220 0.000035 6.320623 2.605101e-10
square_tt_coef -0.110442 0.006296 -17.541428 0.000000e+00


.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 1.803 seconds) .. _sphx_glr_download_auto_examples_assisted_plot_b08selected_specification.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_b08selected_specification.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_b08selected_specification.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_