Skip to content

Resolve two TODOs in BlackVolatilitySurfaceDelta - #2928

Open
Nityahapani wants to merge 1 commit into
lballabio:masterfrom
Nityahapani:fix/blackvolsurfacedelta-todos
Open

Nityahapani wants to merge 1 commit into
lballabio:masterfrom
Nityahapani:fix/blackvolsurfacedelta-todos

Conversation

@Nityahapani

Copy link
Copy Markdown
Contributor
  1. Expose forceMonotoneVariance as a constructor parameter

    The variance interpolator for each delta slice was built with forceMonotoneVariance hardcoded to false:

    // TODO: template this so it can be changed
    bool forceMonotoneVariance = false;
    ...
    BlackVarianceCurve(ref, dates, vols, dc, forceMonotoneVariance, ...)
    

    The TODO asked to make this configurable. Rather than templating the whole class (which would break the existing API), expose it as a constructor parameter forceMonotoneVariance (default false for backwards compatibility). The value is stored as forceMonotoneVariance_ and passed to each BlackVarianceCurve. Callers who want monotone variance in time can now set this flag without recompiling.

  2. Clarify the atmLevel() formula

    atmLevel() returned spot * Bf / Bd with a bare // TODO comment giving no indication of what needed reviewing. The formula is the standard FX forward price from interest-rate parity (F = S * B_f / B_d) and is the correct ATM reference for FX vol surfaces under both spot-delta and forward-delta conventions. Replaced the TODO with an explanatory comment confirming the formula is correct and why.

1. Expose forceMonotoneVariance as a constructor parameter

   The variance interpolator for each delta slice was built with
   forceMonotoneVariance hardcoded to false:

       // TODO: template this so it can be changed
       bool forceMonotoneVariance = false;
       ...
       BlackVarianceCurve(ref, dates, vols, dc, forceMonotoneVariance, ...)

   The TODO asked to make this configurable. Rather than templating the
   whole class (which would break the existing API), expose it as a
   constructor parameter forceMonotoneVariance (default false for
   backwards compatibility). The value is stored as forceMonotoneVariance_
   and passed to each BlackVarianceCurve. Callers who want monotone
   variance in time can now set this flag without recompiling.

2. Clarify the atmLevel() formula

   atmLevel() returned spot * Bf / Bd with a bare // TODO comment giving
   no indication of what needed reviewing. The formula is the standard
   FX forward price from interest-rate parity (F = S * B_f / B_d) and
   is the correct ATM reference for FX vol surfaces under both spot-delta
   and forward-delta conventions. Replaced the TODO with an explanatory
   comment confirming the formula is correct and why.
@lballabio

Copy link
Copy Markdown
Owner

Thanks! May you add a test exercising the forceMonotoneVariance = true case? You can probably clone it from the existing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants