Posted by
Gouthaman Balaraman on
Jun 24, 2016; 1:36pm
URL: http://quantlib.414.s1.nabble.com/Caplet-Volatility-Surface-Construction-tp17561.html
I am using QuantLib python (version 1.8) to strip the caplet volatilities from the CapFloor vol surface. When I did that for a sample data, I noticed that at the short end of the tenor, the caplet and cap volatility surfaces did not match each other as shown in this example on
caplet stripping in QuantLib.
My understanding of the caplet stripping algorithm is that at the shortest end of the tenor for a given strike, the caplet volatilities are assumed to be the same as that of shortest CapFloor volatility. The caplet volatilities are then bootstrapped for increasing tenors to construct the caplet volatilities.
Another thing I couldn't figure how to pass the discount curve for the OptionletStripper1 class. The C++ class constructor definition is:
OptionletStripper1(const boost::shared_ptr< CapFloorTermVolSurface > &,
const boost::shared_ptr< IborIndex > &index,
Rate switchStrikes = Null< Rate >(),
Real accuracy = 1.0e-6, Natural maxIter = 100,
const Handle< YieldTermStructure > &discount =
Handle< YieldTermStructure >(),
const VolatilityType type = ShiftedLognormal,
const Real displacement = 0.0,
bool dontThrow = false);
I am not sure what would be the way to provide the discount variable. I tried:
optionlet_surf = ql.OptionletStripper1(capfloor_vol, ibor_index, discount=ts_handle)
This threw an error saying that 'discount' is not a recognized variable. I wanted to pass as arguments, but then I didn't understand the python equivalent of 'Null<Rate>()' to pass all the default args.
Any help would be much appreciated.
Goutham