.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_ch9\ch9_isocontours.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_ch9_ch9_isocontours.py: ==================================================================================================== 9.11 Heston Process - Intraday interpolation ==================================================================================================== We reproduce here the figure 9.12 of the book. We show intraday interpolation of prices, and show the error against the actual prices. Utilitary functions can be found next to this file. .. GENERATED FROM PYTHON SOURCE LINES 11-13 Necessary Imports ------------------------ .. GENERATED FROM PYTHON SOURCE LINES 13-44 .. code-block:: Python import os import sys from matplotlib import pyplot as plt try: CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) except NameError: CURRENT_DIR = os.getcwd() data_path = os.path.join(CURRENT_DIR, "data") PARENT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, "..")) sys.path.insert(0, PARENT_DIR) from utils.ch9.heston import * params = maps.composition_map([get_pricer_param,get_instrument_param_basket_option_mat])() params['graphic'](params) plt.show() # Repro test params = get_model_param() params = {**params,**get_var_param(params)} params['reproductibility'] = True params = maps.apply_map(params) params = generate_paths(params) params['graphic'](params) plt.show() params = get_var_data() params['graphic'](params) plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_ch9/images/sphx_glr_ch9_isocontours_001.png :alt: ch9 isocontours :srcset: /auto_ch9/images/sphx_glr_ch9_isocontours_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_ch9/images/sphx_glr_ch9_isocontours_002.png :alt: ch9 isocontours :srcset: /auto_ch9/images/sphx_glr_ch9_isocontours_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_ch9/images/sphx_glr_ch9_isocontours_003.png :alt: Hist. training / test set, Synthetic training / test set :srcset: /auto_ch9/images/sphx_glr_ch9_isocontours_003.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.901 seconds) .. _sphx_glr_download_auto_ch9_ch9_isocontours.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ch9_isocontours.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ch9_isocontours.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ch9_isocontours.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_