Hi guys,
I'm still learning QuantLib so appologies in advance if this is something trivial. I'm trying to price some caps/floors in python. I've managed to create a list of IborCoupons and an IborIndex for the instrument easily enough. When I try to use the BlackCapFloorEngine the second parameter is a Handle to a OptionletVolatilityStructure (not a CapFloorTermVolCurve). I've been looking at the source and have not yet seen a derived class of OptionletVolatilityStructure which supports a strike/term vol surface (like CapFloorTermVolSurface - which is not even exported to python). The strange thing is that the CapFloorTermVolCurve is listed in old_volatility.i in the SWIG directory - implying that there's a more recent way to create a strike/term surface (presumably using the OptionletVolatilityStructure Base class) - but the only derived class I've seen so far is the ConstantOptionletVolatility (which is useless as I need a surface). The SpreadedOptionletVolatility class only works if you already have an existing OptionletVolatilityStructure object and the CapletVarianceCurve is deprecated. I don't know what/how to use the StrippedOptionlet class that the comments in the source points to. How do I go about creating a OptionletVolatilityStructure with strikes/dates for the BlackCapFloorEngine? Thanks. |
On Tue, 2009-11-17 at 09:12 -0800, Shuaib Osman wrote:
> I'm still learning QuantLib so appologies in advance if this is something > trivial. I'm trying to price some caps/floors in python. I've managed to > create a list of IborCoupons and an IborIndex for the instrument easily > enough. When I try to use the BlackCapFloorEngine the second parameter is a > Handle to a OptionletVolatilityStructure (not a CapFloorTermVolCurve). I've > been looking at the source and have not yet seen a derived class of > OptionletVolatilityStructure which supports a strike/term vol surface (like > CapFloorTermVolSurface - which is not even exported to python). > > [...] > > How do I go about creating a OptionletVolatilityStructure with strikes/dates > for the BlackCapFloorEngine? I'm still trying to wrap my head myself around those classes (Nando, maybe you could step in?). The quickest thing might be to disregard the fact that CapletVarianceCurve is deprecated and write something similar for strikes/dates instead of just dates (you can follow the structure of, for example, BlackVarianceSurface.) Once you have that in C++, exporting it to Python shouldn't be hard if you clone what's already there. Luigi -- Though this be madness, yet there is method in't. -- Hamlet, Act II, scene II ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |