How can I get the term structure of calpet volatilities implied by a given model? ( I had used the following for cap volatility, and was wondering if startDate in cap/caphelper could somehow be changed to make it a caplet .Or is there some other better way?) :
Handle<Model> modelHW(new HullWhite(rhTermStructure),0.05,0.02);//to plot the curve for a=0.05 / sigma = 0.02 for (double t=1;t<30;t++)
{
CapHelper capHelperObj(Period(t,Years),RelinkableHandle<MarketElement>(Handle<MarketElement>( new SimpleMarketElement(0.1)),indexSixMonths,rhTermStructure); //dummy volatility of 0.1
capHelperObj.setPricingEngine(
Handle<PricingEngine>(new AnalyticalCapFloor(modelHW))); double npv = capHelperObj.modelprice();
double impliedVolatity = capHelperObj.impliedVolatility(npv, 1e-4,
1000, 0.05, 0.50)*100.0; }
Regards,
Amar Do you Yahoo!? The New Yahoo! Shopping - with improved product search |
Hi
Amar,
you
need to bootstrap on all caps spot starting, at first it seems that you don't
need a different start date. The implementation of capHelper shows you how it's
possible to obtain model prices and Black prices, but it has the limitation that
it only works with a single Black volatility, while you would need a volatility
vector.
You
need to see if it's possible to extend this class in order to get the vol vector
as input, or if you need to create a new class. If you choose to create a new
class, you will consider to use, inside it, the existing VanillaCap class, after
testing that this able to work with the VolatilityVector.
Hope
it helps
Francesco
############################### DISCLAIMER ################################# This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. Banca del Gottardo (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. Banca del Gottardo (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. ############################################################################ |
Francesco,
Thanks very much for your help! I actually want to study the effect of different combinations of model parameters , on the termstructure of caplet voaltilities. I was passing a dummy value as voaltility into the constructor of Caphelper, and using the pricing engine based on the model I want to study,to calculate the npv. I am confused, whether the input volatility fed into the constructor of caphelper will have an effect on implied volatility calculation for a model.
Thanks again for your kind help.
Regards,
Amar
Perissin Francesco <[hidden email]> wrote:
Do you Yahoo!? The New Yahoo! Shopping - with improved product search |
In reply to this post by amar singh
Hi
Amar
you
are right, the dummy Black Volatility will have no effect on the helper's NPV.
Same thing holds if you are using impliedVolatility method.
What
you are not able to do at the moment is to calculate the so called "caplet
forward volatilities" implied by the model, since the volatility resulting from
impliedVolatility method is a double, not an array. Instead, you are able to
calculate a vector of "caps par volatilities".
Is it
clearer?
Francesco
############################### DISCLAIMER ################################# This message (including any attachments) is confidential and may be privileged. If you have received it by mistake please notify the sender by return e-mail and delete this message from your system. Any unauthorised use or dissemination of this message in whole or in part is strictly prohibited. Please note that e-mails are susceptible to change. Banca del Gottardo (including its group companies) shall not be liable for the improper or incomplete transmission of the information contained in this communication nor for any delay in its receipt or damage to your system. Banca del Gottardo (or its group companies) does not guarantee that the integrity of this communication has been maintained nor that this communication is free of viruses, interceptions or interference. ############################################################################ |
At 08:48 AM 10/8/03, Perissin Francesco wrote:
>From: amar singh [mailto:[hidden email]] >Sent: martedì, 7 ottobre 2003 20:53 >To: Perissin Francesco; '[hidden email]' >Subject: RE: [Quantlib-users] Caplet volatility structure > >Francesco, > >Thanks very much for your help! I actually want to study the effect of >different combinations of model parameters , on the termstructure of >caplet voaltilities. I was passing a dummy value as voaltility into the >constructor of Caphelper, and using the pricing engine based on the model >I want to study,to calculate the npv. > >Hi Amar >you are right, the dummy Black Volatility will have no effect on the >helper's NPV. Same thing holds if you are using impliedVolatility method. >What you are not able to do at the moment is to calculate the so called >"caplet forward volatilities" implied by the model, since the volatility >resulting from impliedVolatility method is a double, not an array. >Instead, you are able to calculate a vector of "caps par volatilities". Hi all, the problem is, CapHelper is just a helper class for model calibration and is not fit for doing any more than that. The solution to your problem would be to add an impliedVolatility() method to the full featured VanillaCapFloor instrument. Were it available, you could write: // Make a model... Handle<Model> model(new HullWhite(termStructure,a,sigma)); // ...and an engine to price caps on it. Handle<PricingEngine> engine(new TreeCapFloor(model,timeSteps)); // Make a string of 6-months floating-rate coupons. std::vector<Handle<CashFlow> > underlyings = FloatingRateCouponVector(...); // For each one... for (int i=0; i<underlyings.size(); i++) { Handle<CashFlow> coupon = underlyings[i]; // ...make a single-element vector containing the coupon... std::vector<Handle<CashFlow> > singleCoupon(1, coupon); // ...and another one with the appropriate strike for this maturity. Rate strike = ...; std::vector<Rate> singleStrike(1, strike); // Now you can make a single-period cap, i.e., a caplet... VanillaCap caplet(singleCoupon, singleStrike, termStructure, engine); // ...calculate its value according to the model... double price = caplet.NPV(); // ...and if you had this one method (which is the only thing // in this code currently missing from the library), you could // calculate its Black volatility. double capletVolatility = caplet.impliedVolatility(price); // Repeatedly printing (or collecting) the results would give you // the caplet-volatility term structure. std::cout << coupon->date() << "\t" << capletVolatility << std::endl; } Right now I can't assess how much work that would be, therefore I can't promise it will be in next release---and besides, it's wise never to do any such promise :) However, it won't hurt to file it as a feature request on Sourceforge. The URL is http://sourceforge.net/tracker/?group_id=12740&atid=362740 Cheers, Luigi |
In reply to this post by amar singh
Hi Amar,
whats a good way of getting acuainted with quantlib ... whats a good place to start .. do you have any thoughts on that .. ? thanks -Shantanu |
Free forum by Nabble | Edit this page |