|
From: R S <raj...@ho...> - 2019-03-27 21:18:14
|
Thanks for this tip on this serialisation. I attach the results of running Swap pricing with PiecewiseYieldCurve<Discount,LogLinear> versus InterpolatedDiscount<LogLinear> curve (I get similar results when I compare PiecewiseYieldCurve<ForwardRate,BackwardFlat> with InterpolatedDiscount<BackwardFlat>) As you can see, the curve generation time remains unchanged but the swap valuation time is halved (all times in nanoseconds) Is this because the bootstrapping occurs only when NPV on the swap is called? Also, I noticed that certain Trait’s work only with certain interpolators. For example, ForwardRate trait only works with BackwardFlat. Are the valid combinations documented somewhere? Regards -RS On 11 Mar 2019, 16:31 +0000, Luigi Ballabio <lui...@gm...>, wrote: You can use the InterpolatedForwardCurve class, which is used underneath PiecewiseYieldCurve when you select the ForwardRate traits. Once you bootstrap your curve, extract curve.dates(), curve.forwards() and curve.dayCounter() and serialize them. Later, deserialize them and pass them to the InterpolatedForwardCurve constructor. You'll have to instantiate it with the same interpolator you used for the bootstrap, so, for instance, PiecewiseYieldCurve<ForwardRate, BackwardFlat> can be deserialized into an InterpolatedForwardCurve<BackwardFlat>. Other traits have corresponding interpolated curves. Hope this helps, Luigi On Fri, Mar 1, 2019 at 5:50 PM rajs1 <raj...@ho...> wrote: I have seen quite a few older posts on this. What I am trying to do is to send the curve(s) data (in AVRO) along with the swaptrade (AVRO) together. I want to avoid the bootstrap process - so want to resurrect YieldTermStructure from, say, forward rates From 2012, this link: http://quantlib.10058.n7.nabble.com/How-to-construct-a-curve-from-forward-rates-by-using-function-qlInterpolatedYieldCurve-td5242.html talks about building a PiecewiseYieldCurve with TraitsID=ForwardRate. The curve points will be represented internally as forward rates from which - I presume - one could get back to YieldTermStructure. However, most examples deal with QuantlibXL addin. Is there anyone who could point me to a bare bones C++ skeleton (on which I can build and test please)? If there are alternative ideas - I am happy to try and even post back blogs for posterity. Thanks in advance ________________________________ Sent from the quantlib-dev mailing list archive at Nabble.com. _______________________________________________ QuantLib-dev mailing list Qua...@li... https://lists.sourceforge.net/lists/listinfo/quantlib-dev |