Re: Newby Question

Posted by Sutcliffe, Anthony on
URL: http://quantlib.414.s1.nabble.com/Newby-Question-tp7349p7353.html

Thanks again Animesh.
 
So you are essentially suggesting a Monte Carlo type approach? I'm very open to that, just not sure how to implement that either (in quantlib - but keen to avoid reinventing the wheel when quantlib provides a high quality alternative). I've literally just found quantlib so these things are all very much a mystery to me. I think you have got my problem nailed, it's not a complicated problem but as you say the swap value can be achieved by any number of different term structures so maybe a Monte Carlo approach is best.
 
Can I use QuantLibXL to generate a termstructure on a future date? Then as you suggest I could just revalue the swap (right?).
 
I'm also a little foxed by how one gets information out of a handle once it's been created. I used to work with a system called GDA at Merrill Lynch which was similar in that you would create an object from an excel front end, and the quant library would return a handle. But GDA also provided a function called "gdaapply" where you could provide the handle and the name of the field you were after and the value of that field would be returned. Is there something similar in QuantLib.
 
Thanks very much for all your help!
 

Anthony Sutcliffe
Assistant Vice President
Investment Risk Management

State Street Global Advisors Limited
20 Churchill Place, London E14 5HJ

+44 (0)20 3395 6828 (Direct Line)

 

 


From: animesh saxena [mailto:[hidden email]]
Sent: 02 August 2010 11:26
To: Sutcliffe, Anthony
Cc: [hidden email]
Subject: Re: [Quantlib-users] Newby Question

I had assumed a simple vanilla swap priced using a term structure.

Considering a plain vanilla swap. When you are say that you want to "calculate probability of vanilla swap falling below a given value", then this has to be under different interest rates. So mathematically for all possible (although it's lots of computation)  interest rates your swap will take different values and probability will be

Number of cases in which it ends below your pre-specified value / Total number of cases.

Although easy to say but again problem is modeling all these interest rate scenarios (BGM Framework etc). I am not sure if this is your problem or you are thinking of some other approach for calculating probability.

qlHullWhite model might be good, but choosing the parameters is messy. But if you have the calibrated parameters might work. Even if you consider hull white model the equation ( theta(t) - alpha(t) r(t) ) dt + sigma(t) dW (t) will give different values for number of simulations. So each time you do a simulation and calculate the swap value you will get a different value. If you use this to calculate probability (N simulations) then again it all comes down to the calibrated parameters.

I am not sure if there is any inbuilt function for calculating probability. A quantlib developer might know better.
Anyway am also not sure if I missed something obvious in the problem you mentioned!


On 8/2/10 3:17 PM, Sutcliffe, Anthony wrote:
Thanks Animesh.
 
Forgive me for being a little dense (I can't help it), but I'm not quite sure I follow.
 
I can see the term structure and swap example in the example sheet, and I hope I'll be able to manufacture a more complex term structure using a different function (there's a good example of this in the other example sheet). But I'm not sure how modelling the term structure a number of times will reveal the probability of different term structures occurring. Am I missing something obvious?
 
I was expecting to use qlHullWhite, or something similar to model the evolution of the term structure up to some future date, and then revalue the swap on that future date.
 
Alternatively, I wondered if there was a function that allowed the calcuation of the probability of exercise for a swaption, that way I could set up a swaption with an exercise price equal to the one I'm interested in.
 
Have I completely missed the point?
 

Anthony Sutcliffe
Assistant Vice President
Investment Risk Management

State Street Global Advisors Limited
20 Churchill Place, London E14 5HJ

+44 (0)20 3395 6828 (Direct Line)

 


From: animesh saxena [[hidden email]]
Sent: 02 August 2010 10:10
To: Sutcliffe, Anthony
Cc: [hidden email]
Subject: Re: [Quantlib-users] Newby Question

There is a sample given in StandaloneExamples/InterestRateDerivatives.xls file.

Although I am assuming you already have used that file. So regarding calculation of probability I think one of the ways is to model different term-structures, and find the swap values. Calculating the probability then is just a simple division!
In the sheets "Swaps" (Swap value is calculated using the rates in term structures sheet) and "TermStructures", this has been done.
It's been done for a flat forward rate, so a simple solution might be to use a nice macro to change it, and calculate swap values. For more complex term structures you can change this qlFlatForward function and use a different term structure.

Hope this helps.


On 8/2/10 1:00 PM, Sutcliffe, Anthony wrote:

Hello all.

I'm trying to do the following:

To calculate the probability of the value of a swap falling below a given level using the quantlib xl addin. The choice of interest rate model is not that important, as this is just proof of concept, although a term-structure matching version is preferred. I'd also like to be able to display the envelope in which the yield curve will move at a given confidence interval.

I've downloaded the addin and it appears to work, but I'm not sure how to proceed from here. Can anyone give me any pointers?

Thanks very much.

Anthony Sutcliffe
Assistant Vice President
Investment Risk Management
State Street Global Advisors Limited
20 Churchill Place, London E14 5HJ

+44 (0)20 3395 6828 (Direct Line)


------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm
_______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users

-- 
Regards,
Animesh Saxena

(http://quantanalysis.wordpress.com)

-- 
Regards,
Animesh Saxena

(http://quantanalysis.wordpress.com)

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users