.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/tutorials/tutorial_model.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_tutorials_tutorial_model.py: Model specification for the simple tutorial =========================================== Example extracted from Ben-Akiva and Lerman (1985) Michel Bierlaire, EPFL Sun Jun 15 2025, 07:19:46 .. GENERATED FROM PYTHON SOURCE LINES 11-20 .. code-block:: Python from biogeme.expressions import Beta from tutorial_data import auto_time, transit_time asc_car = Beta('asc_car', 0, None, None, 0) b_time = Beta('b_time', 0, None, None, 0) utility_car = asc_car + b_time * auto_time utility_transit = b_time * transit_time .. GENERATED FROM PYTHON SOURCE LINES 21-23 Next, we need to associate the utility function with the ID of the alternative. It is necessary to interpret correctly the value of the variable `choice`. We use a Python dictionary to do that. .. GENERATED FROM PYTHON SOURCE LINES 23-24 .. code-block:: Python utilities = {0: utility_car, 1: utility_transit} .. _sphx_glr_download_auto_examples_tutorials_tutorial_model.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: tutorial_model.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: tutorial_model.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: tutorial_model.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_