Skip to content

Add rough Heston stochastic volatility model - #87

Open
lsbardel wants to merge 1 commit into
mainfrom
claude/heston-model-pricing-xmnjzm
Open

Add rough Heston stochastic volatility model#87
lsbardel wants to merge 1 commit into
mainfrom
claude/heston-model-pricing-xmnjzm

Conversation

@lsbardel

Copy link
Copy Markdown
Member

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

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
Copilot AI review requested due to automatic review settings July 29, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RoughHeston model 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**beta scaling in characteristic_exponent, the inline comment here (“t**beta factor cancels…”) becomes incorrect. Since these weights are computed for h = 1/n (unit interval), the t**beta factor should be applied by the caller.
        h = 1.0 / n  # dt = t / n; the t**beta factor cancels with the psi grid step

Comment thread docs/api/sp/index.md
| 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-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.03846% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.54%. Comparing base (5e16f37) to head (3aec5cb).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
quantflow/sp/rough_heston.py 99.03% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants