.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated_examples\economic\plot_ex1_short_rate_paths.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_examples_economic_plot_ex1_short_rate_paths.py: Short rate paths =================================== Short rate paths generated by the Monte Carlo simulation. The first 10 and 100 paths are plotted. .. seealso:: * :mod:`~economic.BasicHullWhite.HullWhite` in :mod:`~economic.BasicHullWhite` * :doc:`/libraries/notebooks/economic/hull-white-simulation` notebook in the :mod:`~economic` library .. GENERATED FROM PYTHON SOURCE LINES 12-26 .. image-sg:: /generated_examples/economic/images/sphx_glr_plot_ex1_short_rate_paths_001.png :alt: Short rate paths, 10 scenarios, 100 scenarios :srcset: /generated_examples/economic/images/sphx_glr_plot_ex1_short_rate_paths_001.png :class: sphx-glr-single-img .. code-block:: default import modelx as mx import matplotlib.pyplot as plt HW = mx.read_model("BasicHullWhite").HullWhite paths = HW.short_rate_paths() fig, axs = plt.subplots(2, 1, sharex=True, sharey=True) fig.suptitle("Short rate paths") for size, h in zip([10, 100], [0, 1]): for i in range(size): axs[h].plot(range(HW.step_size + 1), HW.short_rate_paths()[i]) axs[h].set_title(str(size) + ' scenarios') .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.377 seconds) .. _sphx_glr_download_generated_examples_economic_plot_ex1_short_rate_paths.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_ex1_short_rate_paths.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_ex1_short_rate_paths.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_