Add rough Heston stochastic volatility model - #87
Open
lsbardel wants to merge 1 commit into
Open
Conversation
Introduce a preliminary first-slice RoughHeston model that prices through the existing characteristic-function pricing pipeline. The variance is a rough (fractional) square-root process with Hurst exponent H, so the roughness index is alpha = H + 1/2. Unlike the classical Heston model, the characteristic function has no closed form: it is obtained by solving the fractional Riccati equation with a fractional Adams (Diethelm-Ford-Freed) predictor-corrector scheme, vectorized over the frequency grid. The model reuses the CIR variance parameters and follows the same time-changed convention as Heston, so the martingale convexity correction is applied by the pricing layer. At H = 1/2 it recovers the classical Heston model. - quantflow/sp/rough_heston.py: RoughHeston model, fractional Adams solver, and an approximate Euler sampler - quantflow_tests/test_rough_heston.py: characteristic-function properties, Heston-limit recovery, Adams convergence, and steeper-skew checks - docs: API stub, COS pricing example, nav entry, index table row, and El Euch-Rosenbaum / Gatheral-Jaisson-Rosenbaum bibliography entries Calibration, a faster Pade characteristic-function solver, a refined Monte Carlo scheme, and a full tutorial are deferred to a later phase. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2vqE1bifN1kmRboBroqLR
There was a problem hiding this comment.
Pull request overview
This PR introduces a preliminary RoughHeston stochastic-volatility model that plugs into Quantflow’s existing characteristic-function based pricing pipeline, plus documentation and tests to validate key properties and the Heston-limit behavior.
Changes:
- Added
RoughHestonmodel with a fractional Adams (Diethelm-Ford-Freed) solver for the fractional Riccati equation, plus an illustrative Euler-style sampler. - Added tests covering characteristic-function properties, Heston-limit recovery, solver-step convergence, skew steepness, and sampling sanity.
- Added API docs stub, an example script, mkdocs nav entry, and bibliography references for rough volatility sources.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
quantflow/sp/rough_heston.py |
New Rough Heston model implementation and fractional Riccati solver integration for characteristic-function pricing. |
quantflow_tests/test_rough_heston.py |
New unit tests validating core mathematical and pricing behaviors of the Rough Heston implementation. |
mkdocs.yml |
Adds Rough Heston API page to documentation navigation. |
docs/references.bib |
Adds bibliography entries for rough Heston / rough volatility references. |
docs/examples/rough_heston_pricer.py |
Adds an example comparing short-maturity implied vols vs classical Heston. |
docs/bibliography.md |
Adds rendered bibliography entries corresponding to the new references. |
docs/api/sp/rough_heston.md |
Adds mkdocstrings API stub page for RoughHeston. |
docs/api/sp/index.md |
Adds Rough Heston to the stochastic-process index table. |
Comments suppressed due to low confidence (1)
quantflow/sp/rough_heston.py:282
- After applying the
t**betascaling incharacteristic_exponent, the inline comment here (“t**beta factor cancels…”) becomes incorrect. Since these weights are computed forh = 1/n(unit interval), thet**betafactor should be applied by the caller.
h = 1.0 / n # dt = t / n; the t**beta factor cancels with the psi grid step
| | Process | Description | | ||
| |---|---| | ||
| | [Heston][quantflow.sp.heston.Heston] | Classical square-root stochastic volatility model | | ||
| | [RoughHeston][quantflow.sp.rough_heston.RoughHeston] | Rough (fractional) Heston model with Hurst exponent H < 1/2 | |
Comment on lines
+212
to
+215
| dt = float(t) / self.adams_steps | ||
| i1 = dt * (0.5 * psi[0] + psi[1:-1].sum(axis=0) + 0.5 * psi[-1]) | ||
| i_frac = self._fractional_integral_weights(1.0 - self.alpha) @ psi | ||
| log_phi = vp.kappa * vp.theta * i1 + vp.rate * i_frac |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #87 +/- ##
==========================================
+ Coverage 88.75% 89.54% +0.78%
==========================================
Files 84 86 +2
Lines 5142 5406 +264
==========================================
+ Hits 4564 4841 +277
+ Misses 578 565 -13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a preliminary first-slice RoughHeston model that prices through
the existing characteristic-function pricing pipeline.
The variance is a rough (fractional) square-root process with Hurst
exponent H, so the roughness index is alpha = H + 1/2. Unlike the
classical Heston model, the characteristic function has no closed form: it
is obtained by solving the fractional Riccati equation with a fractional
Adams (Diethelm-Ford-Freed) predictor-corrector scheme, vectorized over
the frequency grid. The model reuses the CIR variance parameters and
follows the same time-changed convention as Heston, so the martingale
convexity correction is applied by the pricing layer. At H = 1/2 it
recovers the classical Heston model.
and an approximate Euler sampler
Heston-limit recovery, Adams convergence, and steeper-skew checks
El Euch-Rosenbaum / Gatheral-Jaisson-Rosenbaum bibliography entries
Calibration, a faster Pade characteristic-function solver, a refined Monte
Carlo scheme, and a full tutorial are deferred to a later phase.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01E2vqE1bifN1kmRboBroqLR