Add example 1.6: exact Heston Greeks via AADC - #28
Open
mar20tinha-dot wants to merge 1 commit into
Open
Conversation
…F 245x) Four levels of AADC-accelerated differentiation for Heston options: A) Fourier pricing (PROJ method): price + 5 Greeks in 0.8 ms (158x vs FD) B) Calibration: exact Jacobian for 20 instruments (39x vs scipy FD) C) AITF: d(calibrated params)/d(market prices) via IFT (245x vs recalibration) D) Monte Carlo: batch API, 200K paths + 6 Greeks (111x single-thread, 348x 4-thread) All gradients verified against finite differences (ratio 0.999–1.001). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Adds a new example (1.6) showing how AADC (Automatic Adjoint Differentiation) computes exact Heston Greeks, accelerates calibration, and enables implicit differentiation through calibration (AITF).
Four levels of speedup, all verified against the library's own
Fourier_inversion()and finite differences:All gradients match FD (ratio 0.999-1.001). AITF sensitivities match FD recalibration (ratio 1.0000).
Key techniques
idouble(real/imag split) for the Heston characteristic functioncsqrt/clog(Heston CF guarantees re(z) > 0)mark_as_input_no_diff(), oneevaluate()call for all pathsDependencies
aadc(pip install aadc, free evaluation, no licence key)