Skip to content
All library documents

Black Variance Surface Extrapolation in QuantLib

Article Quant Q&A · Author: BHr

Summary

The document explains which extrapolation settings can be changed for a QuantLib BlackVarianceSurface. Enabling extrapolation permits values outside the surface’s defined range, while selecting an interpolation method such as bicubic changes interpolation within the surface. In the behavior described, time extrapolation remains flat and cannot be changed from Python because that rule is hard-coded in the underlying C++ implementation.

Strike-axis extrapolation has a separate setting: it can use the chosen interpolation or revert to flat behavior. This choice is made when constructing the surface, through its final constructor arguments; the default described is to continue the interpolation. The answer thus distinguishes the two axes and clarifies that changing interpolation does not change time extrapolation. It reports a software implementation limitation rather than a general volatility-surface modeling principle, and the stated behavior may depend on the QuantLib version.

Key ideas

  • Enabling extrapolation does not determine the extrapolation method for each axis.
  • Time extrapolation is described as flat and hard-coded in the C++ implementation.
  • The Python interface cannot change the time extrapolation rule described here.
  • Strike extrapolation can follow the selected interpolation or use flat extrapolation.
  • The strike-axis choice is set through constructor arguments.

Tags

Full text
# Quantlib | Issue with extrapolation in BlackVarianceSurface


# Quantlib | Issue with extrapolation in BlackVarianceSurface












I have created BlackVarianceSurface and enabled extrapolation but unable to change extrapolation type used. It is giving flat extrapolation. Used setInterpolation to change method type but extrapolation still coming out as flat. How can that be modified?

Code is:

black_var_surface = ql.BlackVarianceSurface(calculation_date, calendar, expiration_dates, strikes, implied_vols, day_count)

black_var_surface.setInterpolation("bicubic")

black_var_surface.enableExtrapolation()

## Answer by Luigi Ballabio (score 2)

https://quant.stackexchange.com/a/39250

You can't, at least from Python. Currently, flat extrapolation in time it's hard-coded. To modify that, you'll have to change the underlying C++ code.

(On the other hand, you can select whether extrapolation on the strike axis should use the provided interpolation or go flat. The default is to use the interpolation, and the choice needs to be made when building the curve; see the last two constructor arguments.)

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.