Skip to content

Commit 7ecc27e

Browse files
committed
More docs
1 parent 7ddec0e commit 7ecc27e

24 files changed

+341
-91
lines changed

notebooks/_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ logo: assets/quantflow-light.svg
99
# Force re-execution of notebooks on each build.
1010
# See https://jupyterbook.org/content/execute.html
1111
execute:
12-
#execute_notebooks: "off"
13-
execute_notebooks: force
12+
execute_notebooks: "off"
13+
# execute_notebooks: force
1414

1515
# Define the name of the latex output file for PDF builds
1616
latex:

notebooks/api/options/black.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
==================================
2+
Black Pricing
3+
==================================
4+
5+
.. module:: quantflow.options.bs
6+
7+
.. autofunction:: black_price
8+
9+
.. autofunction:: black_vega
10+
11+
.. autofunction:: implied_black_volatility

notebooks/api/options/calibration.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
==================================
2+
Vol Model Calibration
3+
==================================
4+
5+
.. module:: quantflow.options.calibration
6+
7+
.. autoclass:: VolModelCalibration
8+
:members:
9+
:member-order: groupwise
10+
:autosummary:
11+
:autosummary-nosignatures:
12+
13+
14+
.. autoclass:: HestonCalibration
15+
:members:
16+
:member-order: groupwise
17+
:autosummary:
18+
:autosummary-nosignatures:

notebooks/api/options/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ Option Pricing
44

55
.. currentmodule:: quantflow.options
66

7+
The :mod:`options` module provides classes and functions for pricing and analyzing options.
8+
The main class is the :class:`.VolSurface` class which is used to represent
9+
a volatility surface for a given asset.
10+
A volatility surface is usually created via a :class:`.VolSurfaceLoader` object.
11+
712
.. toctree::
813
:maxdepth: 1
914

1015
vol_surface
16+
black
17+
pricer
18+
calibration

notebooks/api/options/pricer.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
==================================
2+
Option Pricer
3+
==================================
4+
5+
The option pricer module provides classes for pricing options using
6+
different stochastic volatility models.
7+
8+
9+
.. module:: quantflow.options.pricer
10+
11+
.. autoclass:: OptionPricer
12+
:members:
13+
:member-order: groupwise
14+
:autosummary:
15+
:autosummary-nosignatures:
16+
17+
18+
.. autoclass:: MaturityPricer
19+
:members:
20+
:member-order: groupwise
21+
:autosummary:
22+
:autosummary-nosignatures:

notebooks/api/options/vol_surface.rst

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
==================================
2-
VolSurface
2+
Vol Surface
33
==================================
44

55
.. module:: quantflow.options.surface
66

77
.. autoclass:: VolSurface
88
:members:
9+
:member-order: groupwise
10+
:autosummary:
11+
:autosummary-nosignatures:
12+
13+
14+
.. autoclass:: VolCrossSection
15+
:members:
16+
:member-order: groupwise
17+
:autosummary:
18+
:autosummary-nosignatures:
19+
20+
.. autoclass:: GenericVolSurfaceLoader
21+
:members:
22+
:member-order: groupwise
23+
:autosummary:
24+
:autosummary-nosignatures:
25+
26+
27+
.. autoclass:: VolSurfaceLoader
28+
:members:
29+
:member-order: groupwise
30+
:autosummary:
31+
:autosummary-nosignatures:

notebooks/api/sp/cir.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ The Cox–Ingersoll–Ross (CIR) model
88

99
.. autoclass:: CIR
1010
:members:
11+
:member-order: groupwise
12+
:autosummary:
13+
:autosummary-nosignatures:
14+

notebooks/api/sp/compound_poisson.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Compound Poisson
66

77
.. autoclass:: CompoundPoissonProcess
88
:members:
9+
:member-order: groupwise
10+
:autosummary:
11+
:autosummary-nosignatures:
12+

notebooks/api/sp/heston.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Heston process
66

77
.. autoclass:: Heston
88
:members:
9+
:member-order: groupwise
10+
:autosummary:
11+
:autosummary-nosignatures:
12+

notebooks/api/sp/jump_diffusion.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,14 @@ The most famous jump-diffusion model is the Merton model, which was introduced b
1111

1212
.. autoclass:: JumpDiffusion
1313
:members:
14+
:member-order: groupwise
15+
:autosummary:
16+
:autosummary-nosignatures:
17+
1418

1519

1620
.. autoclass:: Merton
1721
:members:
22+
:member-order: groupwise
23+
:autosummary:
24+
:autosummary-nosignatures:

notebooks/api/sp/ou.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ These are the classes that implement gaussian and non-gaussian
1010

1111
.. autoclass:: Vasicek
1212
:members:
13+
:member-order: groupwise
14+
:autosummary:
15+
:autosummary-nosignatures:
1316

1417

1518
.. autoclass:: GammaOU
1619
:members:
20+
:member-order: groupwise
21+
:autosummary:
22+
:autosummary-nosignatures:

notebooks/api/sp/poisson.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Poisson process
66

77
.. autoclass:: PoissonProcess
88
:members:
9+
:member-order: groupwise
10+
:autosummary:
11+
:autosummary-nosignatures:
12+

notebooks/api/sp/weiner.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Weiner process
66

77
.. autoclass:: WeinerProcess
88
:members:
9+
:member-order: groupwise
10+
:autosummary:
11+
:autosummary-nosignatures:
12+

notebooks/reference/glossary.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,18 @@ kernelspec:
1515

1616
## Characteristic Function
1717

18-
The characteristic function of a random variable $x$ is the Fourier transform of $P^x$, where $P^x$ is the distrubution measure of $x$
18+
The characteristic function of a random variable $X$ is the Fourier transform of $f_X$, where $f_X$ is the probability density function
19+
of $X$
1920
\begin{equation}
20-
\Phi_{x,u} = {\mathbb E}\left[e^{i u x_t}\right] = \int e^{i u x} P^x\left(dx\right)
21+
\Phi_{X,u} = {\mathbb E}\left[e^{i u X_t}\right] = \int e^{i u x} f_X\left(x\right) dx
22+
\end{equation}
23+
24+
## Cumulative Distribution Function (CDF)
25+
26+
The cumulative distribution function (CDF), or just distribution function,
27+
of a real-valued random variable $X$ is the function given by
28+
\begin{equation}
29+
F_X(x) = P(X \leq x)
2130
\end{equation}
2231

2332
## Hurst Exponent
@@ -28,7 +37,7 @@ Check this study on the [Hurst exponent with OHLC data](./applications/hurst).
2837

2938
## Moneyness
3039

31-
Monenyness is used in the context of option pricing and it is defined as
40+
Moneyness is used in the context of option pricing and it is defined as
3241

3342
\begin{equation}
3443
\ln\frac{K}{F}
@@ -39,3 +48,12 @@ where $K$ is the strike and $F$ is the Forward price. A positive value implies s
3948
```{code-cell}
4049
4150
```
51+
52+
## Probability Density Function (PDF)
53+
54+
The [probability density function](https://en.wikipedia.org/wiki/Probability_density_function)
55+
(PDF), or density, of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value. It is related to the CDF by the formula
56+
57+
\begin{equation}
58+
F_X(x) = \int_{-\infty}^x f_X(s) ds
59+
\end{equation}

poetry.lock

Lines changed: 44 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Documentation = "https://quantmind.github.io/quantflow/"
1515
python = ">=3.11"
1616
scipy = "^1.14.1"
1717
pydantic = "^2.0.2"
18-
ccy = {version="1.6.0"}
18+
ccy = { version = "^1.7.1" }
1919
python-dotenv = "^1.0.1"
2020
polars = {version = "^1.11.0", extras=["pandas", "pyarrow"]}
2121
asciichartpy = { version = "^1.5.25", optional = true }
@@ -27,7 +27,7 @@ click = {version = "^8.1.7", optional = true}
2727
[tool.poetry.group.dev.dependencies]
2828
black = "^24.1.1"
2929
pytest-cov = "^6.0.0"
30-
mypy = "^1.13.0"
30+
mypy = "^1.14.1"
3131
ghp-import = "^2.0.2"
3232
ruff = "^0.8.1"
3333
pytest-asyncio = "^0.25.0"

0 commit comments

Comments
 (0)