Skip to content
All library documents

Computing Bartlett SABR Vega from a QuantLib Volatility Cube

Article Quant Q&A · Author: user35980

Summary

The discussion addresses how to calculate Bartlett-adjusted vega when a QuantLib SABR swaption volatility cube derives its forward rates internally from a spot curve. Since the cube does not expose forward rates as direct inputs, the proposed workaround approximates the forward-rate sensitivity by applying small parallel shifts to the curve used to construct the cube. The shift size is based on the Bartlett adjustment factor for each smile section.

To isolate the implied-volatility effect, the cube and the pricing engine must use independent curve instances: the cube’s curve is shifted while the pricer’s forwards remain unchanged. Curve shifts create unwanted sensitivities in other smile sections, so the method compares the adjustment matrix with the ordinary SABR alpha-vega matrix and retains adjustments only where that matrix indicates a relevant sensitivity. The resulting full-surface calculation can be applied across instrument classes, but it is computationally slow because the surface must be recalculated for each smile section. The discussion presents a workaround, not a benchmark of its accuracy or performance.

Key ideas

  • The cube derives its forward rates from an input spot curve, unlike a SABR volatility function that accepts a forward directly.
  • Approximate the required forward-rate perturbation by shifting the curve used to build the cube.
  • Use a separate curve for the pricing engine so the perturbation affects implied volatility without also shifting pricer forwards.
  • Filter adjustment sensitivities by the smile sections with nonzero ordinary SABR alpha-vega.
  • The full-surface procedure is flexible across instruments but adds substantial computation.

Tags

Full text
# Bumping forward rates in Quantlib for Bartlett SABR greeks


# Bumping forward rates in Quantlib for Bartlett SABR greeks












This might be a naive question, but in order to compute the Barlett vega: $$ \frac{d\sigma}{d\alpha} + \frac{d\sigma}{dF}\frac{\rho F^\beta}{\nu}$$ (for forward rate $F$, implied vol $\sigma$, and SABR params $\alpha,\beta,\nu,\rho$) the standard finite difference method is to compute the impacted implied vol and feed that into a pricer, then take differences in the NPVs. Now when using the `SabrSwaptionVolatilityCube` class in Quantlib, the only rate input is a built spot rate curve (the class then calculates the atm forward rates from this curve internally - as can be verified from the .atmLevel() attribute). It seems then that any rate sensitivities can only be done by shifting the (spot) source rates. By contrast the `sabrVolatility` class takes the forward rate as a direct input. The issue is that in the SABR vol cube case to compute the Barlett vega correction, we need to shift the forward rates directly (by a $\rho F^\beta/\nu$ factor) to return a modified cube (then feed it into a pricer and take NPV differences ...etc). Is there a way to do this?

## Answer by user35980 (score 2)

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

I believe I managed to find a workaround for this issue:

- Use parallel shifts of the input rate curve, with the shifts being the Bartlett adjustment factor $\frac{\rho F^\beta}{\nu}\epsilon$ (for some small increment $\epsilon$) corresponding to each smile section. This returns a matrix $B$ of the vega adjustments (capturing the $F$ and $\alpha$ correlation).

- In order to compute $B$ a separate instance of the forward rate curve needs to be fed to the SABR vol cube constructor, and an independent one to the pricer. This is important because only the SABR implied vols should be impacted in this calculation. Otherwise the $dF$ action in 1. will shift the pricer forwards as well which is not what you want.

- The vega adjustment matrix $B$ will have delta noise in all smile sections since we're parallel shifting the whole input rate curve. These have to be filtered out in the next step:

- Compute the standard SABR surface vega $\frac{d\sigma}{d\alpha}$ matrix $V$. A lookup for the relevant smile sections that exhibit sensitivities then needs to be done to select only adjustment factors from $B$ which correspond to non-zero values in $V$, zeroing out all other to get a matrix $\bar{B}$. Then the Barlett (full swaption surface) vega is given by $V+\bar{B}$.

The above approach has a drawback that computation has to be done on the full surface level for every smile section, so it slows the vega calculation down considerably. But the major benefit of it appears to be that it's a global method for calculating Bartlett SABR vega across all instrument classes.

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.