Skip to content

Commit

Permalink
Add heston with jumps
Browse files Browse the repository at this point in the history
  • Loading branch information
lsbardel committed Jul 14, 2023
1 parent 1707ba1 commit c132d22
Show file tree
Hide file tree
Showing 9 changed files with 588 additions and 9 deletions.
36 changes: 36 additions & 0 deletions notebooks/api/sp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,39 @@ IntensityProcess

.. autoclass:: IntensityProcess
:members:


WeinerProcess
=====================

.. module:: quantflow.sp.weiner

.. autoclass:: WeinerProcess
:members:


PoissonProcess
=====================

.. module:: quantflow.sp.poisson

.. autoclass:: PoissonProcess
:members:


CompoundPoissonProcess
=======================

.. module:: quantflow.sp.poisson

.. autoclass:: CompoundPoissonProcess
:members:


Heston
=======================

.. module:: quantflow.sp.heston

.. autoclass:: Heston
:members:
51 changes: 51 additions & 0 deletions notebooks/models/heston_jumps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.14.7
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

# Heston Model with Jumps

```{code-cell} ipython3
from quantflow.sp.heston import HestonJ
pr = HestonJ.create(
vol=0.6,
kappa=2,
sigma=1.5,
rho=-0.3,
jump_intensity=100,
jump_fraction=0.3,
jump_skew=1.5
)
pr
```

```{code-cell} ipython3
from quantflow.utils import plot
plot.plot_marginal_pdf(pr.marginal(0.1), 128, normal=True, analytical=False)
```

```{code-cell} ipython3
from quantflow.options.pricer import OptionPricer
from quantflow.sp.heston import Heston
pricer = OptionPricer(pr)
pricer
```

```{code-cell} ipython3
fig = None
for ttm in (0.05, 0.1, 0.2, 0.4, 0.6, 1):
fig = pricer.maturity(ttm).plot(fig=fig, name=f"t={ttm}")
fig.update_layout(title="Implied black vols", height=500)
```

```{code-cell} ipython3
```
4 changes: 0 additions & 4 deletions notebooks/models/poisson.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,3 @@ m.characteristic(2)
```{code-cell} ipython3
m.characteristic(-2).conj()
```

```{code-cell} ipython3
```
Binary file added notebooks/quantflow-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions notebooks/quantflow-repo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c132d22

Please sign in to comment.