Hello,
I am creating a cap volatility curve (see the code below). I have created correctly the yield term structure, the vector atmVolatilityHandle (see the code) is well constructed (I used a cout in each for step and the iATMVol used are well defined), but when I go to create the capfloorATMVolCurve the following exception raise: "not enough points to interpolate: at least 2 required, 0 provided" iOptionTenors is an std::vector<Period> with the list of the option tenors considered in the iATMVOL (e.g. 1Y,18M,2Y,3Y,4Y,5Y,6Y,7Y,8Y,9Y,10Y,12Y,15Y,20Y, 25Y,30Y); -> size ot iATMVol and iOptionTenors is the same. iRefDate is the evaluationDate (which is the reference date of the yield term structure). Any suggestion? Thanks and regards, Paolo /* START CODE */ std::vector<Handle<Quote>> atmVolatilityHandle; atmVolatilityHandle.resize(nTenors); int i=0; for (i=0; i<nTenors; ++i) { atmVolatilityHandle[i] = Handle<Quote>(boost::shared_ptr<Quote>(new SimpleQuote (iATMVol[i]))); } Handle<CapFloorTermVolCurve> capfloorATMVolCurve; capfloorATMVolCurve = Handle<CapFloorTermVolCurve>(boost:: shared_ptr<CapFloorTermVolCurve>(new CapFloorTermVolCurve(iRefDate, iCal, iRollConv, iOptionTenors, atmVolatilityHandle))); /* END CODE */ ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
On Fri, 2010-08-13 at 09:16 +0200, [hidden email] wrote:
> I am creating a cap volatility curve (see the code below). > I have created correctly the yield term structure, the vector > atmVolatilityHandle (see the code) is well constructed (I used a cout in each > for step and the iATMVol used are well defined), but when I go to create the > capfloorATMVolCurve the following exception raise: > "not enough points to interpolate: at least 2 required, 0 provided" Can you send a self-contained example we can try to run? Thanks, Luigi -- No, I'm not interested in developing a powerful brain. All I'm after is just a mediocre brain, something like the president of American Telephone and Telegraph Company. -- Alan Turing on the possibilities of a thinking machine, 1943. ------------------------------------------------------------------------------ This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |