Add smileSection() to BlackVolTermStructure#2487
Open
quantales wants to merge 1 commit intolballabio:masterfrom
Open
Add smileSection() to BlackVolTermStructure#2487quantales wants to merge 1 commit intolballabio:masterfrom
quantales wants to merge 1 commit intolballabio:masterfrom
Conversation
ec3e810 to
ea5987f
Compare
ea5987f to
5886cf3
Compare
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.
This PR proposes adding
smileSection(Date/Time)toBlackVolTermStructure, making EQ/FX vol surfaces in line with the IR ones (OptionletVolatilityStructure,SwaptionVolatilityStructure).smileSection()smileSectionImpl(Time)provides a default adapter that wrapsblackVol()into aSmileSectionsmileSection()with no code changesUnlike the IR vol structures where
smileSectionImplis pure virtual, the default adapter here means vol-native classes (BlackConstantVol,HestonBlackVolSurface, etc.) would work out of the box. Smile-native classes can override for efficiency:PiecewiseBlackVarianceSurfacedoes so in this PR, returning its storedSmileSectiondirectly at stored tenors.BlackVolatilitySurfaceDeltais another candidate: its existingblackVolSmile()methods are functionally equivalent tosmileSection()and could be refactored to overridesmileSectionImpl()in a follow-up.Motivation: From the discussions in #2443, #2478, and #2368, and increasing use of
SmileSectionfor EQ/FX vol surfaces (PiecewiseBlackVarianceSurfaceandBlackVolatilitySurfaceDelta), the base class not returning them felt like a gap (there was no way to get aSmileSectionfrom aPiecewiseBlackVarianceSurfaceand users needing one from any otherBlackVolTermStructurewould have to write their own adapter each time). Happy to adjust and would love to hear your thoughts on this.Tests: default adapter (BlackConstantVol), override at stored tenor with pointer equality (PiecewiseBlackVarianceSurface), adapter fallback between tenors. Full suite passes.