Re: [Quantlib-users] yield curve bootstrapping

 Re: [Quantlib-users] yield curve bootstrapping From: stefano sampietro - 2010-04-21 15:07:05 ```Hi, I have also worked with "Yield curve bootstrapping" file and I'm noticed a numerical instability of the function (with discount factor as output). The attached file contains real data and, as you can see, the function gives #NUM!. The problem comes from the red cells (3m and 9m deposits): I know they look like "strange" numbers, but they are real numbers... so my questions are: can quantlibXL functions handle this kind of (real) situation? Is it possible to increase the numerical robustness? P.S. Is the point the monotonicity of the discount factor curve? Thanks a lot Stefano ---------- Initial Header ----------- >From : "Ferdinando Ametrano" nando@... To : "Paolo Baroni" baronister@... Cc : quantlib-users@... Date : Wed, 21 Apr 2010 11:26:02 +0200 Subject : Re: [Quantlib-users] yield curve bootstrapping > Hi Paolo > > > I'm trying to understand how works the spreadsheet "Yield curve > > bootstrapping" and as first test I tried to calculate the discount factors > > of Depo rates. > > As you can see in the xls in attachment my > > df are slightly (but always) greater then the df calculated by qlxl. > > I use the formula df = 1/(1+Depo*(dd/360)). > > Can someone explain me where I wrong? > > you got wrong all dd but the first one and didn't take into account > the fact that all deposit but ON are "forward" deposit with respect to > today's date > > You missed the peculiar nature of ON and TN deposits, which apply from > today to tomorrow and from tomorrow to spot date respectively. TN is a > "forward" deposit: its discount is the product of the discount > generated by ON times its own discounting term 1/(1+Depo*(dd/360)). > > The same is for all other deposits which start from spot, not from > today. Their own discounting term 1/(1+Depo*(dd/360)) must be > multiplied for the discount at spot date > > Please find attached a workbook with fixed calculations. > > ciao -- Nando > ```

 Re: [Quantlib-users] yield curve bootstrapping From: stefano sampietro - 2010-04-21 15:07:05 ```Hi, I have also worked with "Yield curve bootstrapping" file and I'm noticed a numerical instability of the function (with discount factor as output). The attached file contains real data and, as you can see, the function gives #NUM!. The problem comes from the red cells (3m and 9m deposits): I know they look like "strange" numbers, but they are real numbers... so my questions are: can quantlibXL functions handle this kind of (real) situation? Is it possible to increase the numerical robustness? P.S. Is the point the monotonicity of the discount factor curve? Thanks a lot Stefano ---------- Initial Header ----------- >From : "Ferdinando Ametrano" nando@... To : "Paolo Baroni" baronister@... Cc : quantlib-users@... Date : Wed, 21 Apr 2010 11:26:02 +0200 Subject : Re: [Quantlib-users] yield curve bootstrapping > Hi Paolo > > > I'm trying to understand how works the spreadsheet "Yield curve > > bootstrapping" and as first test I tried to calculate the discount factors > > of Depo rates. > > As you can see in the xls in attachment my > > df are slightly (but always) greater then the df calculated by qlxl. > > I use the formula df = 1/(1+Depo*(dd/360)). > > Can someone explain me where I wrong? > > you got wrong all dd but the first one and didn't take into account > the fact that all deposit but ON are "forward" deposit with respect to > today's date > > You missed the peculiar nature of ON and TN deposits, which apply from > today to tomorrow and from tomorrow to spot date respectively. TN is a > "forward" deposit: its discount is the product of the discount > generated by ON times its own discounting term 1/(1+Depo*(dd/360)). > > The same is for all other deposits which start from spot, not from > today. Their own discounting term 1/(1+Depo*(dd/360)) must be > multiplied for the discount at spot date > > Please find attached a workbook with fixed calculations. > > ciao -- Nando > ```
 Re: [Quantlib-users] yield curve bootstrapping From: stefano sampietro - 2010-04-21 15:08:55 Attachments: YieldCurveBootstrapping_realdata.xls ```Sorry, here is the file, Stefano ---------- Initial Header ----------- >From : "Ferdinando Ametrano" nando@... To : "Paolo Baroni" baronister@... Cc : quantlib-users@... Date : Wed, 21 Apr 2010 11:26:02 +0200 Subject : Re: [Quantlib-users] yield curve bootstrapping > Hi Paolo > > > I'm trying to understand how works the spreadsheet "Yield curve > > bootstrapping" and as first test I tried to calculate the discount factors > > of Depo rates. > > As you can see in the xls in attachment my > > df are slightly (but always) greater then the df calculated by qlxl. > > I use the formula df = 1/(1+Depo*(dd/360)). > > Can someone explain me where I wrong? > > you got wrong all dd but the first one and didn't take into account > the fact that all deposit but ON are "forward" deposit with respect to > today's date > > You missed the peculiar nature of ON and TN deposits, which apply from > today to tomorrow and from tomorrow to spot date respectively. TN is a > "forward" deposit: its discount is the product of the discount > generated by ON times its own discounting term 1/(1+Depo*(dd/360)). > > The same is for all other deposits which start from spot, not from > today. Their own discounting term 1/(1+Depo*(dd/360)) must be > multiplied for the discount at spot date > > Please find attached a workbook with fixed calculations. > > ciao -- Nando > ```
 Re: [Quantlib-users] yield curve bootstrapping From: stefano sampietro - 2010-04-22 12:10:20 ```Hi Nando, thx for your reply; now it's clear to me that the problem is the negativness of the fwd rates (I trust you about the robustness of quantlib!:)). Unfortunately market data could lead to this kind of inconsistencies (update times not exactly equal, different liquidity, and so on...) I tried using euribor future instead of long deposit, but the problem still remains (my guess is that with these low euro rates, few bips are enough to create problems...) Anyway I think I will fix by compiling with QL_NEGATIVE_RATES, thx ciao Stefano ---------- Initial Header ----------- >From : ferdinando.ametrano@... To : "stefano sampietro" stefano.sampietro@... Cc : "quantlib-users" quantlib-users@...,"baronister" baronister@... Date : Wed, 21 Apr 2010 19:01:01 +0200 Subject : Re: [Quantlib-users] yield curve bootstrapping > On Wed, Apr 21, 2010 at 5:06 PM, stefano sampietro > wrote: > > Hi, I have also worked with "Yield curve bootstrapping" file and I'm noticed a numerical instability of the function (with discount factor as output). > > The attached file contains real data and, as you can see, the function gives #NUM!. > > The problem comes from the red cells (3m and 9m deposits): I know they look like "strange" numbers, but they are real numbers... so my questions are: can quantlibXL functions handle this kind of (real) situation? Is it possible to increase the numerical robustness? > > > > P.S. Is the point the monotonicity of the discount factor curve? > > yes, the 3M rate generates a discount factor lower than the one > implied by the 4M rate, implying negative forward rate between 3M-4M. > They might be "real numbers" but are "fake values"... > > If you ever need to allow negative forward rates you have to compile > the library with QL_NEGATIVE_RATES defined, so even this dummy > unrealistic situation could be handled. > > Trust me: QuantLib's bootstrapping is numerically very robust and has > handled all curve shapes emerged in the last 6 years. > > ciao -- Nando > ```
 Re: [Quantlib-users] yield curve bootstrapping From: Ferdinando Ametrano - 2010-04-22 16:23:22 ```Hi Stefano > Unfortunately market data could lead to this kind of inconsistencies > (update times not exactly equal, different liquidity, and so on...) no way. It's almost 13 years now I work on interest rates as quant/trader/developer and I've never encountered such a problem in the EUR market > Anyway I think I will fix by compiling with QL_NEGATIVE_RATES if you have to go that way in the EUR market I bet some relevant money you have something dramatically wrong in your system ciao -- Nando ```
 Re: [Quantlib-users] yield curve bootstrapping From: Paolo Baroni - 2010-04-23 05:19:07 Attachments: Message as HTML ```Hi Stefano, some month ago I had a similar problem with rates. In that case was that I didn't download rates fixed at the same time. When I fixed this problem I didn't see the negativness of the fwd rates anymore. Hope this help Ciao Paolo 2010/4/22 stefano sampietro > Hi Nando, thx for your reply; now it's clear to me that the problem is the > negativness of the fwd rates (I trust you about the robustness of > quantlib!:)). > Unfortunately market data could lead to this kind of inconsistencies > (update times not exactly equal, different liquidity, and so on...) I tried > using euribor future instead of long deposit, but the problem still remains > (my guess is that with these low euro rates, few bips are enough to create > problems...) > Anyway I think I will fix by compiling with QL_NEGATIVE_RATES, thx > > ciao > Stefano > > ---------- Initial Header ----------- > > From : ferdinando.ametrano@... > To : "stefano sampietro" stefano.sampietro@... > Cc : "quantlib-users" quantlib-users@...,"baronister" > baronister@... > Date : Wed, 21 Apr 2010 19:01:01 +0200 > Subject : Re: [Quantlib-users] yield curve bootstrapping > > > On Wed, Apr 21, 2010 at 5:06 PM, stefano sampietro > > wrote: > > > Hi, I have also worked with "Yield curve bootstrapping" file and I'm > noticed a numerical instability of the function (with discount factor as > output). > > > The attached file contains real data and, as you can see, the function > gives #NUM!. > > > The problem comes from the red cells (3m and 9m deposits): I know they > look like "strange" numbers, but they are real numbers... so my questions > are: can quantlibXL functions handle this kind of (real) situation? Is it > possible to increase the numerical robustness? > > > > > > P.S. Is the point the monotonicity of the discount factor curve? > > > > yes, the 3M rate generates a discount factor lower than the one > > implied by the 4M rate, implying negative forward rate between 3M-4M. > > They might be "real numbers" but are "fake values"... > > > > If you ever need to allow negative forward rates you have to compile > > the library with QL_NEGATIVE_RATES defined, so even this dummy > > unrealistic situation could be handled. > > > > Trust me: QuantLib's bootstrapping is numerically very robust and has > > handled all curve shapes emerged in the last 6 years. > > > > ciao -- Nando > > > > ```
 Re: [Quantlib-users] yield curve bootstrapping From: Ferdinando Ametrano - 2010-04-21 17:02:50 ```On Wed, Apr 21, 2010 at 5:06 PM, stefano sampietro wrote: > Hi, I have also worked with "Yield curve bootstrapping" file and I'm noticed a numerical instability of the function (with discount factor as output). > The attached file contains real data and, as you can see, the function gives #NUM!. > The problem comes from the red cells (3m and 9m deposits): I know they look like "strange" numbers, but they are real numbers... so my questions are: can quantlibXL functions handle this kind of (real) situation? Is it possible to increase the numerical robustness? > > P.S. Is the point the monotonicity of the discount factor curve? yes, the 3M rate generates a discount factor lower than the one implied by the 4M rate, implying negative forward rate between 3M-4M. They might be "real numbers" but are "fake values"... If you ever need to allow negative forward rates you have to compile the library with QL_NEGATIVE_RATES defined, so even this dummy unrealistic situation could be handled. Trust me: QuantLib's bootstrapping is numerically very robust and has handled all curve shapes emerged in the last 6 years. ciao -- Nando ```