.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/bayesian_swissmetro/plot_b19_individual_level_parameters.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_bayesian_swissmetro_plot_b19_individual_level_parameters.py: 19. Calculation of individual level parameters ============================================== Calculation of the individual level parameters for the model defined in :ref:`plot_b05_normal_mixture`. Michel Bierlaire, EPFL Mon Nov 17 2025, 18:59:56 .. GENERATED FROM PYTHON SOURCE LINES 12-17 .. code-block:: Python from IPython.core.display_functions import display from biogeme.bayesian_estimation import BayesianResults .. GENERATED FROM PYTHON SOURCE LINES 18-19 Retrieve estimation results .. GENERATED FROM PYTHON SOURCE LINES 19-22 .. code-block:: Python result_file_name = 'saved_results/b05_normal_mixture.nc' the_estimation_results = BayesianResults.from_netcdf(filename=result_file_name) .. rst-class:: sphx-glr-script-out .. code-block:: none load finished in 9732 ms (9.73 s) .. GENERATED FROM PYTHON SOURCE LINES 23-25 With Bayesian estimation, the individual-level parameters are automatically generated. We simply retrieve them from estimation results. .. GENERATED FROM PYTHON SOURCE LINES 25-27 .. code-block:: Python sim = the_estimation_results.posterior_mean_by_observation(var_name='b_time_rnd') display(sim) .. rst-class:: sphx-glr-script-out .. code-block:: none b_time_rnd obs 0 -2.700321 1 -2.707648 2 -2.789338 3 -2.523579 4 -2.652483 ... ... 6763 -1.349442 6764 -1.225173 6765 -1.192921 6766 -0.839448 6767 -1.303646 [6768 rows x 1 columns] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 9.942 seconds) .. _sphx_glr_download_auto_examples_bayesian_swissmetro_plot_b19_individual_level_parameters.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_b19_individual_level_parameters.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_b19_individual_level_parameters.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_b19_individual_level_parameters.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_