Skip to content

Support irregular volatility surface inputs #1

Description

@asancdec

Replace core::VolSurface<T> with irregular volatility surface support

Motivation

The current core::VolSurface<T> assumes a rectangular grid:

  • one shared strike/moneyness vector
  • one maturity vector
  • one Matrix<T> of vols where each tenor has the same number of strikes

This is convenient for model surfaces, but real market data is often irregular: each maturity/tenor may have a different set of listed strikes or log-moneyness points.

Goal

Replace the current rectangular core::VolSurface<T> representation with first-class support for irregular volatility surfaces where each maturity owns its own strike/moneyness/vol slice.

Possible shape:

template <std::floating_point T>
struct VolSlice
{
    T maturity;
    T forward;
    T discountFactor;
    Vector<T> strikes;
    Vector<T> moneyness;
    Vector<T> vol;
};

template <std::floating_point T>
class IrregularVolSurface
{
    Vector<VolSlice<T>> slices_;
};

Requirements

  • Each maturity/tenor should own its own volatility slice.
  • Each slice should allow a different number of strikes.
  • Each slice should validate that strikes, moneyness, and vol have matching sizes.
  • Maturities should be strictly increasing.
  • Strikes/moneyness inside each slice should be ordered consistently.
  • Existing code using core::VolSurface<T> should be migrated to the new irregular representation.
  • Model pricing and calibration code should consume the new structure directly.

Migration scope

Replace usages of the current rectangular surface in:

  • core surface construction
  • Heston pricing inputs
  • SVI/local-vol calibration inputs where applicable
  • integration tests
  • regression fixtures
  • performance tests

Out of scope

  • Arbitrage repair.
  • Full volatility surface interpolation.
  • Calibration algorithm redesign beyond the data-structure migration.
  • Backward compatibility with the old rectangular VolSurface<T> unless explicitly needed during transition.

Acceptance criteria

  • Add the new irregular volatility surface representation.
  • Remove or deprecate the old rectangular core::VolSurface<T> API.
  • Add unit tests for valid irregular surfaces.
  • Add unit tests for variable strike counts across maturities.
  • Add unit tests rejecting inconsistent slice dimensions.
  • Add unit tests rejecting non-increasing maturities.
  • Update existing model, integration, regression, and performance tests to use the new representation.
  • Document the new surface layout and expected invariants.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions