Add IFT + AAD sensitivity for SANOS LP calibration - #9
Open
mar20tinha-dot wants to merge 4 commits into
Open
Conversation
added 3 commits
July 9, 2026 18:26
Compute ∂(fitted surface)/∂(market quotes) via the Implicit Function Theorem on active constraints — no re-calibration needed. - cvxpy_ift.py: reusable IFT module for any LP/QP (scipy.linprog) - example_sanos_ift.py: self-contained example with validation and benchmark Reference: Goloubentsev, Lakshtanov, Piterbarg (2022) "Automatic Implicit Function Theorem", Risk, March 2022. SSRN 3984964.
Documents usage, benchmarks, and mathematical background.
Part II of the IFT+AAD pipeline: - sanos_downstream_aadc.cpp: barrier MC with AADC reverse-mode AD Records tape: surface → local vol → GBM paths → barrier payoff One reverse pass → ∂price/∂(all surface nodes) - sanos_e2e_test.py: end-to-end Python IFT + C++ AAD + chain rule - sanos_full_test.py: multi-expiry LP + IFT + downstream (pure Python) - Updated README with full pipeline documentation End-to-end benchmark: 66x speedup over bump-and-recalibrate.
Complete Python pipeline: market quotes → SANOS LP calibration → IFT sensitivity → AADC tape (surface → local vol → MC barrier → price) → chain rule → ∂(exotic price)/∂(all vanilla quotes) Tested output: Part I: IFT vs bump max error < 3e-11 (exact) Part II: 15 quotes, barrier price + all Greeks in 0.2s Speedup: 34x over bump-and-reprice (15 quotes) Requires: numpy, scipy, cvxpy, aadc (https://matlogica.com/aadc)
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
Compute exact sensitivities of any downstream exotic price w.r.t. all vanilla option quotes — through the SANOS LP calibration — without re-calibrating.
Part I: IFT through LP (pure Python)
At the LP optimum, active constraints define an invertible linear system. The Implicit Function Theorem gives the exact Jacobian
∂C_fit/∂quotefrom a single linear solve.Part II: AAD downstream (C++/AADC)
The MC pricing kernel (surface → local vol → GBM → barrier payoff) is recorded on an AADC tape. One reverse pass gives
∂price/∂surfacefor all grid nodes.Chain rule
All N sensitivities from 1 LP + 1 linear solve + 1 AAD MC pass.
Files added
cvxpy_ift.pyexample_sanos_ift.pysanos_full_test.pysanos_downstream_aadc.cppsanos_e2e_test.pyREADME_ift.mdBenchmarks
Dependencies
References