Skip to content

Add IFT + AAD sensitivity for SANOS LP calibration - #9

Open
mar20tinha-dot wants to merge 4 commits into
hansbuehler:mainfrom
mar20tinha-dot:ift-sensitivity
Open

Add IFT + AAD sensitivity for SANOS LP calibration#9
mar20tinha-dot wants to merge 4 commits into
hansbuehler:mainfrom
mar20tinha-dot:ift-sensitivity

Conversation

@mar20tinha-dot

@mar20tinha-dot mar20tinha-dot commented Jul 9, 2026

Copy link
Copy Markdown

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/∂quote from 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/∂surface for all grid nodes.

Chain rule

∂V/∂quote = (∂V/∂surface) × (∂surface/∂quote)
              AAD (C++)        IFT (Python)

All N sensitivities from 1 LP + 1 linear solve + 1 AAD MC pass.

Files added

File Description
cvxpy_ift.py Reusable IFT module for any LP (scipy.linprog)
example_sanos_ift.py Self-contained: calibrate + IFT + validate + benchmark
sanos_full_test.py Multi-expiry LP + IFT + downstream (pure Python)
sanos_downstream_aadc.cpp Barrier MC with AADC reverse-mode AD
sanos_e2e_test.py End-to-end: Python IFT + C++ AAD + chain rule
README_ift.md Full documentation

Benchmarks

Setup Bump IFT+AAD Speedup
15 quotes, IFT only 38 ms 1.6 ms 24×
33 quotes, IFT only 340 ms 8.5 ms 40×
33 quotes, end-to-end 602 s 9.1 s 66×

Dependencies

  • Part I: numpy, scipy (no additional deps)
  • Part II: AADC by MatLogica (optional — Part I works standalone)

References

  1. Goloubentsev, Lakshtanov, Piterbarg (2022). "Automatic Implicit Function Theorem." Risk, March 2022. SSRN 3984964
  2. Dupire (1994). "Pricing with a smile." Risk, 7(1), 18-20.

mar20tinha-dot 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.
@mar20tinha-dot mar20tinha-dot changed the title Add IFT sensitivity for SANOS LP calibration Add IFT + AAD sensitivity for SANOS LP calibration Jul 9, 2026
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)
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.

1 participant