Output zero rates can differ from the input rates by quite a bit

Posted by StephenWong on
URL: http://quantlib.414.s1.nabble.com/Output-zero-rates-can-differ-from-the-input-rates-by-quite-a-bit-tp6690.html

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.