Repository navigation
Conversation
|
|
Rebase onto current main and address review: run against QuantLibAAD 1.44.0 with COSHestonEngine as written, move the AAD computation into aad_sensitivities() returning the forward-start value and a dict of sensitivities keyed by input name, replace the forward-difference check on the eight largest sensitivities with central differences over all 114 inputs, and add a CHANGELOG entry. Run on QuantLibAAD 1.44.0: calibrated theta 0.0722 kappa 3.6199 sigma 1.2293 rho -0.5790 v0 0.1289, forward-start value 480.63; largest relative difference over all 114 inputs 1.8e+00 (vol 3600 2W). The ten largest sensitivities agree to 2.4e-04-1.8e-03; the worst case is a small sensitivity that comes entirely through recalibration, which a 1e-5 bump does not move enough to register -- see the note in the example.
0217edd to
2f0b28b
Compare
|
Review points addressed (same as #23):
Run on QuantLibAAD 1.44.0: calibrated theta 0.0722, kappa 3.6199, sigma 1.2293, rho -0.5790, v0 0.1289; forward-start value 480.63 — all unchanged from the 1.33.3 run. Full run takes about 8 minutes (228 recalibrations). The CLA is still unsigned on my side; that is separate from these changes. |
|
Thanks for the detailed note on the check and the COS engine. We'll look at the finite-difference comparison closely in the review, but first this PR needs a signed CLA, like #23 to #25: the link is in the bot comment at the top, with a "recheck" link if you've signed already. If the CLA is a concern, say so and we'll help. Please also update the PR description (it still mentions the 1.33.3 run and the analytic-engine substitution). The review continues as soon as the CLA check is green. |
Closes #19.
Python port of the
AdjointHestonModelC++ example, following the pattern ofswap-adjoint.py:HestonModelHelperwithPriceError),COSHestonEngine(model, 12, 75), Levenberg-Marquardt at tolerance 1e-12 starting from (0.1, 1.0, 0.5, -0.5, 0.1), then a forward-start call (strike set in 6M, expiry 18M) priced withAnalyticHestonForwardEuropeanEngine.aad_sensitivities()function returning the forward-start value and a dict of sensitivities keyed by input name. All 114 inputs are cross-checked inside the example by bump-and-recalibrate with central differences (for the spot, h is 1e-5 relative to its scale).Testing: run on QuantLibAAD 1.44.0 (Python 3.12), with the calibration run on
COSHestonEngineas written: calibrated theta 0.0722, kappa 3.6199, sigma 1.2293, rho -0.5790, v0 0.1289, forward-start value 480.63. Largest relative difference over all 114 inputs: 1.8 (vol 3600 2W). That worst case is a property of the check, not the sensitivities: vol 3600 2W's direct sensitivity is exactly 0.0, so its whole value comes through recalibration, and a 1e-5 bump barely moves the optimizer (it stops on a stationary function value), capturing only ~35% of the recalibration effect; at h = 1e-4 it captures ~95%. The ten largest sensitivities agree to 2.4e-04–1.8e-03. This is explained in the example; happy to use a larger bump for the check if you prefer.Note: this repo requires a signed CLA before merge (per CONTRIBUTING) — I understand it will be handled through the CLA flow.