Yield curve bootstrapping

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

Yield curve bootstrapping

mihai.bunea
Could someone please explain the algorithm behind bootstrapping of a yield curve from deposit rates?

I have an example of a yield curve consisting of 2 legs with the following maturities and rates:
1) maturity: 1 year, rate: 10% per year.
2) maturity: 2 years, rate: 20% per year.

How is the zero-rate computed for the second leg?

Legs use simple compounding for interest rate, so the time value of money is F = S (1 + r * t).
F = future sum of money
S = spot (current) sum of money
r = yearly interest rate
t = time, in years

For the first leg: 1$ now becomes 1.1$ in one year. The zero-rate equation is: 1 * e^(r1 * 1) = 1.1, therefore r1 = Ln(1.1) = 0.0953102, which is precisely what Quantlib computes.

For the second leg however, my assumptions on the calculation no longer hold. 1$ becomes (1 + 0.2 * 2) = 1.4$ in 2 years.
The zero-rate equation would be 1 * e^(r2 * 2) = 1.4, so r2 = Ln(1.4) / 2 = 0.168236. Quantlib computes something close, 0.167967 but definitely not exactly the same thing.

Somehow the 1'st leg enters the zero-rate equation of the 2'nd leg, but couldn't find out a documentation on how it's done.
Reply | Threaded
Open this post in threaded view
|

Re: Yield curve bootstrapping

Luigi Ballabio
On Thu, 2011-02-24 at 08:16 -0800, mihai.bunea wrote:
> I have an example of a yield curve consisting of 2 legs with the following
> maturities and rates:
> 1) maturity: 1 year, rate: 10% per year.
> 2) maturity: 2 years, rate: 20% per year.

May you post the code?  It might help diagnosing the problem.

Luigi


--

Lubarsky's Law of Cybernetic Entomology:
There is _always_ one more bug.



------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Yield curve bootstrapping

mihai.bunea
Hello Luigi,

thanks for answering.

Looking over the code again helped and i found the problem: 2012 is a leap year.
I used 1-Mar-2011 as reference date, Unadjusted business day convention and Actual365Fixed day counter. Then added 365 days, respectively 2 * 365 days to obtain maturities of 1, respective 2 years.

The problem is the calendar-based year fraction is not exactly 1 or 2 in this case.
When i replaced the reference date with 1-Mar-2012 (after the leap day of 29-Feb-2012), it worked by the book.

That is, 1y tenor with 10% rate => 1$ after 1y -> 1.1$ => discount =~ 0.909091
           2y tenor with 20% rate => 1$ after 1y -> 1.4$ => discount =~ 0.714286