.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_ch9\ch9_HestonRepro.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_HestonRepro.py: ==================================================================================================== 9.09 Heston Process - Reproducibility ==================================================================================================== We reproduce here the figure 9.10 and 9.11 of the book. We show a reproducibility test for a Heston process as well as a comparison of the generated noise with a generative method. Utilitary functions can be found next to this file. .. GENERATED FROM PYTHON SOURCE LINES 11-13 Necessary Imports ------------------------ .. GENERATED FROM PYTHON SOURCE LINES 13-34 .. 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 * fig_test_reproductibility_Heston() plt.show() table = fig_compare_distributions_Heston() print(table) plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_ch9/images/sphx_glr_ch9_HestonRepro_001.png :alt: ch9 HestonRepro :srcset: /auto_ch9/images/sphx_glr_ch9_HestonRepro_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_ch9/images/sphx_glr_ch9_HestonRepro_002.png :alt: ch9 HestonRepro :srcset: /auto_ch9/images/sphx_glr_ch9_HestonRepro_002.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none Mean Variance Skewness Kurtosis KS test HestonDiffLog lat.:0 0.00011(-0.0001) -0.045(0.043) 9.8e-05(0.0001) 0.8(1) 0.6(0.05) HestonCondMap lat.:0 -0.016(-0.01) 0.048(0.064) 1.1(1.1) 0.06(0.03) 0.96(0.05) HestonCondMap lat.:1 -1.6e-16(-0.069) -1.2e-15(-0.066) 0.5(0.49) -0.037(-0.28) 0.19(0.05) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 13.809 seconds) .. _sphx_glr_download_auto_ch9_ch9_HestonRepro.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: ch9_HestonRepro.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: ch9_HestonRepro.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: ch9_HestonRepro.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_