Define and correctly spell SabrParametricVolatility calibration-grid axis accessors - #348
Open
mattmenefee wants to merge 1 commit into
Open
Conversation
The accessors exposing the calibration grid axes were declared on SabrParametricVolatility but never defined, so any call to them failed to link. Without them the public alpha(), beta(), nu(), rho() and calibrationError() matrices - stored as rows = underlying lengths, cols = option expiries - cannot be mapped back to the (timeToExpiry, underlyingLength) grid nodes they describe. Define both accessors to return the existing timeToExpiries_ and underlyingLengths_ members, and correct their misspelled names while they are still uncallable: - timeToEpiries() becomes timeToExpiries() - underlyingLenghts() becomes underlyingLengths() Because neither function was ever defined, no caller could have linked against the old spellings, so the rename breaks no existing code.
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
SabrParametricVolatilitydeclares two accessors for its calibration-grid axes inqle/termstructures/sabrparametricvolatility.hpp:Neither is defined in
sabrparametricvolatility.cppor anywhere else in the tree, so calling either one fails at link time with an undefined symbol. This PR:timeToExpiries_/underlyingLengths_members.timeToEpiries→timeToExpiries,underlyingLenghts→underlyingLengths— along with thelenghtstypos in the two adjacent comments.Why this matters
The class publicly exposes its calibration results as matrices —
alpha(),beta(),nu(),rho(),lognormalShift(),numberOfCalibrationAttempts(),calibrationError(),isInterpolated()— laid out as rows = underlying lengths, cols = option expiries. Without the axis vectors, a caller cannot map a matrix cell back to the(timeToExpiry, underlyingLength)node it was calibrated at, which makes the matrices unusable for per-pillar calibration diagnostics or reporting.On the rename
Renaming a public accessor would normally be a source-breaking change. It is not one here: since neither function was ever defined, no code could have linked against the old spellings. Correcting them now is free; after the definitions ship it stops being free.
Happy to drop the rename and keep the original spellings if you would rather preserve the declared names verbatim — the definitions are the substantive part of the change.
Test plan
QuantExtcompiles and links cleanly with the changelibQuantExtbinary