Pricing¶
The characteristic function is evaluated numerically at param.H and inverted via Fourier quadrature. The base_solution constructor argument selects the Riccati solver:
base_solution |
When to use |
|---|---|
"auto" (default) |
"exact_heston" if \(H = \tfrac{1}{2}\), else "direct_riccati" with implicit-\(\pi\) |
"root_pade" |
\(H\) away from \(\tfrac{1}{2}\); fast closed-form approximation, less accurate at long maturities and on steep skews |
"exact_heston" |
\(H = \tfrac{1}{2}\) exactly (classical Heston closed form); the other bases warn there |
"pade" |
Gatheral \([m/m]\) Padé, for comparison: much less accurate than "root_pade" (the accuracy check warns), and order "44" can fail near \(H = 0\) |
"direct_riccati" |
Full numerical Volterra solve; most stable and accurate, slower than the Padé bases |
ivs = model.eur_call_put(
K=K,
maturity=T,
implied_vol=True,
payoff_selection="otm", # calls for K >= F, puts for K < F
integration="panel",
L=200.0, # Fourier truncation
time_steps=500, # time-grid nodes for Volterra solve
)
print(ivs)
# Direct numerical Riccati solve
benchmark_model = RoughHeston(
param, riskfree=0.0, base_solution="direct_riccati"
)
ivs_benchmark = benchmark_model.eur_call_put(
K=K, maturity=T, implied_vol=True, L=200.0
)
Adaptive Fourier truncation¶
Use integration="adaptive_panel" to let the pricer automatically select \(L\):
ivs = model.eur_call_put(
K=K,
maturity=T,
implied_vol=True,
expansion_order=0,
integration="adaptive_panel",
adaptive_tol=1e-4, # stop when max IV change < 1e-4
adaptive_verbose=True,
)