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 |
As for the call with a discount curve: for the time being, ql.nullDouble() will give you a Null<Real> that you can pass to the constructor. If you want to recompile, instead, you can enable keyword arguments by adding %feature("kwargs") OptionletStripper1Ptr; to the OptionletStripper1Ptr class, before the %extend block. It's not always possible (it isn't if there's more than one constructor) but it should work in this case. Luigi On Fri, Jun 24, 2016 at 4:50 PM Gouthaman Balaraman <[hidden email]> wrote: I am using QuantLib python (version 1.8) to strip the caplet volatilities ------------------------------------------------------------------------------ Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today. http://sdm.link/attshape _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Thanks. This was helpful.
|
Free forum by Nabble | Edit this page |