# 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?

1. 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).
2. 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.
3. 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:
4. 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}$$.