On Sun, 2009-06-21 at 09:58 -0400, Khanh Nguyen wrote:
> This question relates to my current project RQuantLib. Is it possible
> to reconstruct a YieldTermStructure object from the following data
>
> > data.frame(curves$time, curves$zero)
> curves.time curves.zero
> 1 0.0 0.03907353
> 2 0.1 0.03763962
> 3 0.2 0.03792946
> ....
> 100 9.9 0.05163158
> 101 10.0 0.05173125
>
> the 'curves' object is built from this data using quantlib
>
> tsQuotes <- list(d1w =0.0382,
> d1m =0.0372,
> fut1=96.2875,
> fut2=96.7875,
> fut3=96.9875,
> fut4=96.6875,
> fut5=96.4875,
> fut6=96.3875,
> fut7=96.2875,
> fut8=96.0875,
> s3y =0.0398,
> s5y =0.0443,
> s10y =0.05165,
> s15y =0.055175)
I'm not familiar with RQuantLib, so I'll have to make some guesses.
Since you list a set of deposits, futures, and swaps, I assume that you
built a piecewise yield curve. If you want to store it and reconstruct
it later, your best choice would be to store the nodes of the curve (for
instance, with your set of inputs you'd have a node at 1 week, one at 1
month etc.) From here though, I can only guess. For instance, when you
build the piecewise curve you can interpolate on discount factors, zero
yields, or forwards. Depending on what you chose, the nodes will
contain different values and you'll need to know what you have stored in
order to rebuild the curve (using an InterpolatedDiscountCurve, or an
InterpolatedZeroCurve...) Also, the data you're listing above are at
t=0.1, 0.2 etc, and seem to be some kind of regular sampling of the
curve rather than the values at the nodes. With those data, you won't be
able to reconstruct the curve exactly.
Luigi
--
This gubblick contains many nonsklarkish English flutzpahs, but the
overall pluggandisp can be glorked from context.
-- David Moser
------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
QuantLib-users@...
https://lists.sourceforge.net/lists/listinfo/quantlib-users