BNS Model#
The Barndorff-Nielson–Shephard (BNS) model is a stochastic volatility model where the variance process \(\nu_t\), or better, the activity rate process, follows a non-gaussian OU process. The leverage effect can be accommodated by correlating the Brownian motion \(w_t\) and the BDLP \(z_t\) as the following equations illustrate:
This means that the characteristic function of \(y_t\) can be represented as
\(\phi_{w, u}\) is the characteristic exponent of \(w_1\). The second equivalence is a consequence of \(w\) and \(\tau\) being independent, as discussed in the time-changed Lévy process section.
from quantflow.sp.bns import BNS
pr = BNS.create(vol=0.5, decay=10, kappa=10, rho=-1)
pr
BNS(variance_process=GammaOU(rate=0.25, kappa=10.0, bdlp=CompoundPoissonProcess[Exponential](intensity=2.5, jumps=Exponential(decay=10.0))), rho=-1.0)
from quantflow.utils import plot
m = pr.marginal(2)
plot.plot_characteristic(m, max_frequency=10)
Marginal Distribution#
m.mean(), m.std()
(np.float64(1.13220528467725e-08), np.float64(0.524669184061491))
plot.plot_marginal_pdf(m, 128, normal=True, analytical=False)
Appendix#
Carr at al [CPM03] show that the join characteristic function of \(\tau_t\) and \(z_{\kappa t}\) has a closed formula, and this is our derivation
Noting that (see non-gaussian OU process)
we obtain
Here we use sympy to derive the integral in the characteristic function.
import sympy as sym
k = sym.Symbol("k")
iβ = sym.Symbol("iβ")
γ = sym.Symbol("γ")
s = sym.Symbol("s")
ϕ = s/(s+iβ)/(γ-k*s)
ϕ
r = sym.integrate(ϕ, s)
sym.simplify(r)
import numpy as np
f = lambda x: x*np.log(x)
f(0.001)
np.float64(-0.006907755278982137)