compounding in QuantLib

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

compounding in QuantLib

Jicun Zhong

Hi,

   When one set floating index fixing, depo rate, swap rate etc. in order to build a yield curve etc. what compounding does QuantLib assume on these rate numbers? It seems that when the curve is built then everything is converted to continuous compounding so return a rate from the curve is assumed to be continuous compounding. Also discounting, forward casting etc. based on the curve is also using continuous compounding. Could someone please clarify all these issues or point to a proper documentation.

   Thanks!

 

Jicun


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: compounding in QuantLib

Luigi Ballabio
On Tue, 2011-07-05 at 10:57 +0200, Jicun Zhong wrote:
>    When one set floating index fixing, depo rate, swap rate etc. in
> order to build a yield curve etc. what compounding does QuantLib
> assume on these rate numbers? It seems that when the curve is built
> then everything is converted to continuous compounding so return a
> rate from the curve is assumed to be continuous compounding. Also
> discounting, forward casting etc. based on the curve is also using
> continuous compounding. Could someone please clarify all these issues
> or point to a proper documentation.

The index fixings, depo rates etc. are assumed to be in their natural
compounding (for instance, depo rates are assumed to be simply
compounded, as quoted on the market; the swap rate is supposed to be the
rate paid by the fixed-rate swap coupons, as quoted by the market, etc.)

The market rates are then used to bootstrap an interpolated curve.
Internally, the curve keeps a vector of nodes.  Depending on which curve
you choose, the nodes could store discount factors, zero rates, or
instantaneous forward rates.  The discount factors are just the discount
factors for the node dates, so there's no compounding involved.  Rates
are continuously compounded, but keep in mind that they're not just a
conversion of the input rates: there's a bootstrap procedure (for
instance, the 10-year-node rate is not the 10-year-swap rate, converted
to continuous copounding; it is the continuously-compounded rate, found
by a process of root solving, such that the 10-year swap repriced on the
curve--and taking into account all previous nodes, too--has null NPV.)

Finally, that's just the internal representation of the curve; you can
extract rates with the compounding you want.  The relevant methods are
zeroRate() and forwardRate(), which allow you to specify the compounding
and the day-count convention of the rate returned.

Hope this clarifies most of it.  Let me know if anything's still
unclear.

Luigi


--

It is better to know some of the questions than all of the answers.
-- James Thurber



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: compounding in QuantLib

Jicun Zhong
This definitely clarified a lot. Thanks for the info. If I run into more specific questions I will post them later.
Thanks!

Jicun

-----Original Message-----
From: Luigi Ballabio [mailto:[hidden email]]
Sent: den 11 juli 2011 14:55
To: Jicun Zhong
Cc: [hidden email]
Subject: Re: [Quantlib-users] compounding in QuantLib

On Tue, 2011-07-05 at 10:57 +0200, Jicun Zhong wrote:
>    When one set floating index fixing, depo rate, swap rate etc. in
> order to build a yield curve etc. what compounding does QuantLib
> assume on these rate numbers? It seems that when the curve is built
> then everything is converted to continuous compounding so return a
> rate from the curve is assumed to be continuous compounding. Also
> discounting, forward casting etc. based on the curve is also using
> continuous compounding. Could someone please clarify all these issues
> or point to a proper documentation.

The index fixings, depo rates etc. are assumed to be in their natural
compounding (for instance, depo rates are assumed to be simply
compounded, as quoted on the market; the swap rate is supposed to be the
rate paid by the fixed-rate swap coupons, as quoted by the market, etc.)

The market rates are then used to bootstrap an interpolated curve.
Internally, the curve keeps a vector of nodes.  Depending on which curve
you choose, the nodes could store discount factors, zero rates, or
instantaneous forward rates.  The discount factors are just the discount
factors for the node dates, so there's no compounding involved.  Rates
are continuously compounded, but keep in mind that they're not just a
conversion of the input rates: there's a bootstrap procedure (for
instance, the 10-year-node rate is not the 10-year-swap rate, converted
to continuous copounding; it is the continuously-compounded rate, found
by a process of root solving, such that the 10-year swap repriced on the
curve--and taking into account all previous nodes, too--has null NPV.)

Finally, that's just the internal representation of the curve; you can
extract rates with the compounding you want.  The relevant methods are
zeroRate() and forwardRate(), which allow you to specify the compounding
and the day-count convention of the rate returned.

Hope this clarifies most of it.  Let me know if anything's still
unclear.

Luigi


--

It is better to know some of the questions than all of the answers.
-- James Thurber


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users