Repository navigation
Check the CDS and American option samples, and bump their sensitivities without AAD - #59
Open
auto-differentiation-dev wants to merge 2 commits into
Open
auto-differentiation-dev wants to merge 2 commits into
auto-differentiation-dev wants to merge 2 commits into
Conversation
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.
AdjointCDS printed 8 of its 9 hazard-rate sensitivities and shifted the recovery, fixed-rate and notional sensitivities by one entry. Neither AdjointCDS nor AdjointAmericanEquityOption had a sample test, and without AAD both printed only the price.
Changes
QLAAD_DISABLE_AAD=ON), both samples compute their sensitivities by bump and revalue (forward differences for the CDS, central differences for the American option) and print them in the same formatctest -R "^Adjoint"), so the workflow is unchangedCheckSample.cmakegets a helper that compares numbers printed in iostreams' default format, scientific notation includedTesting
The tests fail on the old CDS print and on the dividend rho that AAD gave before lballabio/QuantLib#3057, and pass in AAD and non-AAD builds, together with the existing sample tests, against current QuantLib master plus two pending fixes that let it compile with AD types. The two new check scripts also run with CMake 3.15, QuantLib's minimum. The bumped and AAD sensitivities agree to within 1e-5 relative for both samples.