Heston Volatility Surface

Heston Volatility Surface#

Here we study the Implied volatility surface of the Heston model. The Heston model is a stochastic volatility model that is widely used in the finance industry to price options.

from quantflow.sp.heston import HestonJ
from quantflow.options.pricer import OptionPricer

pricer = OptionPricer(model=HestonJ.exponential(
    vol=0.5,
    kappa=2,
    rho=0.0,
    sigma=0.6,
    jump_fraction=0.5,
    jump_asymmetry=1.0
))
pricer
OptionPricer(model=HestonJ[DoubleExponential](variance_process=CIR(rate=0.125, kappa=2.0, sigma=0.6, theta=0.125, sample_algo=<SamplingAlgorithm.implicit: 'implicit'>), rho=0.0, jumps=CompoundPoissonProcess[DoubleExponential](intensity=100.0, jumps=DoubleExponential(decay=40.0, loc=0.0, kappa=1.0))), n=128, max_moneyness_ttm=1.5)
fig = None
for ttm in (0.1, 0.5, 1):
    fig = pricer.maturity(ttm).plot(fig=fig, name=f"ttm={ttm}")
fig
pricer.plot3d(max_moneyness_ttm=1.5, support=31).update_layout(
    height=800,
    title="Heston volatility surface",
)