Hello fellow QL users,
I encountered a problem and I wonder if anyone else has seen it? The problem can be essentially boiled down to if I feed a sequence of zero rates into the PiecewiseYieldCurve, use that as the YieldTermStructure in a PricingEngine. After pricing a zero coupon bond, the same sequence of zero rates I get back from the term structure are not all identical to the inputs. Most of the zero rates are identical except for a few in the sequence. Those seem to be much worse than the rest. It does not matter if the sequence is at intervals of every half year or every year, there are always a few in the sequence that differ more from the inputs than I would like to tolerate. For example if I feed in the zero rates in the second column, I got the output in the third column Yr Input (%) Output (%) 1 4.29 4.290 2 4.64 4.638707 <---- 3 4.79 4.789613 <---- 4 4.87 4.870 5 4.92 4.920 6 4.94 4.940 7 4.96 4.960 8 4.96 4.959969 9 4.96 4.960 10 4.95 4.950 Or Yr Input (%) Output (%) 0.5 4.29 4.290 1 4.64 4.640 1.5 4.79 4.790 2 4.87 4.869173 <---- 2.5 4.92 4.92 3 4.94 4.939856 <---- 3.5 4.96 4.959861 <---- 4 4.96 4.960 4.5 4.96 4.960 5 4.95 4.950 I thought the accuracy would be a little bit better than this. Is this not a problem? Thanks! Stephen. |
On Thu, 2011-11-03 at 13:25 -0700, StephenWong wrote:
> The problem can be essentially boiled down to if I feed a sequence of zero > rates > into the PiecewiseYieldCurve, use that as the YieldTermStructure in a > PricingEngine. > After pricing a zero coupon bond, the same sequence of zero rates I get back > from > the term structure are not all identical to the inputs. What do you mean "feeding zero rates into the PiecewiseYieldCurve"? You don't feed zero rates in that, you feed deposit rates, swap rates, futures... Do you mean some other class? Luigi -- There is no opinion so absurd that some philosopher will not express it. -- Marcus Tullius Cicero, "Ad familiares" ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Yes Luigi you are right! I meant feeding those rates into the PiecewiseYieldCurve through a bunch of DepositRateHelpers. |
On Fri, 2011-11-04 at 06:36 -0700, StephenWong wrote:
> > What do you mean "feeding zero rates into the PiecewiseYieldCurve"? > > You don't feed zero rates in that, you feed deposit rates, swap rates, > > futures... Do you mean some other class? > Yes Luigi you are right! I meant feeding those rates into the > PiecewiseYieldCurve through a bunch of DepositRateHelpers. Then I rather expect you won't get the same rates if you ask the curve for zero rates. They have different conventions. Luigi -- The Feynman Problem Solving Algorithm: 1) Write down the problem. 2) Think very hard. 3) Write down the solution. ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
But I used the same day count convention in the DepositRateHelpers and in the YieldTermStructure::zeroRate call. |
On Nov 4, 2011, at 10:43 PM, StephenWong wrote: > Luigi Ballabio wrote: >> On Fri, 2011-11-04 at 06:36 -0700, StephenWong wrote: >>>> What do you mean "feeding zero rates into the PiecewiseYieldCurve"? >>>> You don't feed zero rates in that, you feed deposit rates, swap >>>> rates, >>>> futures... Do you mean some other class? >> >>> Yes Luigi you are right! I meant feeding those rates into the >>> PiecewiseYieldCurve through a bunch of DepositRateHelpers. >> >> Then I rather expect you won't get the same rates if you ask the >> curve >> for zero rates. They have different conventions. >> > > But I used the same day count convention in the DepositRateHelpers > and in > the YieldTermStructure::zeroRate call. Day count convention is not all. Deposit rates are not compounded. If you don't specify a compounding convention, zero rates are continuously compounded. Luigi ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Thanks for the answers and your patience, Luigi! That explains why I have to choose Compounding:Simple in YieldTermStructure::zeroRate to even get those output rates that I listed. Anything else would give much worse rates. What is the logic behind using no compounding? May be this should be added in the document/manual? |
On Nov 6, 2011, at 10:26 AM, StephenWong wrote: > Thanks for the answers and your patience, Luigi! That explains why I > have to > choose Compounding:Simple in YieldTermStructure::zeroRate to even > get those > output rates that I listed. Anything else would give much worse rates. > > What is the logic behind using no compounding? That's the way deposit rates are defined and quoted on the market. It's not really a QuantLib thing... Luigi ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |