Repository navigation
Conversation
|
|
|
@tylrcc friendly reminder: the CLA (link in the bot comment above) is the only thing holding these four PRs. It takes a minute to sign, and then we can get CI going and review them. |
Rebase onto current main and address review: run against QuantLibAAD 1.44.0, move the AAD computation into aad_sensitivities() returning the option value and a dict of sensitivities keyed by input name, replace the forward-difference check with central differences over all 5 inputs, and add a CHANGELOG entry. QuantLibAAD 1.44.0 fixes the zero dividend rho with finite-difference engines, so the caveat is removed and the dividend yield is included in the check. Run on QuantLibAAD 1.44.0: option value 4.4861132726; largest relative difference over all 5 inputs 9.8e-06 (risk-free rate), limited by the finite-difference engine's grid noise.
adcac43 to
986e767
Compare
|
Review points addressed (same as #23):
American-specific point: the 1.44.0 fix is confirmed — the adjoint dividend rho is now 9.046355 against a bumped 9.046284, so the old zero-dividend-rho caveat is removed from the example and the dividend yield is included in the check. Option value 4.4861132726, unchanged from the 1.33.3 run. The CLA is still unsigned on my side; that is separate from these changes. |
|
Thanks for the update here too. Same as on #23: this PR needs a signed CLA before we can review or merge it. The link is in the bot comment at the top (and there's a "recheck" link if you've signed and it still shows pending). If the CLA itself is a problem, let us know. Please also update the PR description, which still refers to the 1.33.3 run. We'll pick the review up as soon as the CLA check is green. |
Closes #16.
Python port of the
AdjointAmericanEquityOptionC++ example, following the pattern ofswap-adjoint.py:FdBlackScholesVanillaEngine(801 time steps, 800 grid points).aad_sensitivities()function returning the option value and a dict of sensitivities keyed by input name. The example cross-checks the Greeks against central differences (h = 1e-5) over all five inputs.Testing: run on QuantLibAAD 1.44.0 (Python 3.12): value 4.4861132726, largest relative difference over all 5 inputs: 9.8e-06 (risk-free rate). The residual is the 801-step FD grid's own noise rather than adjoint error — it does not shrink as h varies (checked at h = 1e-3/1e-4/1e-5/1e-6), while strike and underlying agree to ~1e-7; this is noted in the example.
Dividend rho: on 1.44.0 the adjoint dividend rho matches bumping (9.046355 vs 9.046284), so the earlier zero-dividend-rho caveat is removed from the example and dividend yield is included in the check.
Note: this repo requires a signed CLA before merge (per CONTRIBUTING) — I understand it will be handled through the CLA flow.