|
From: Luigi B. <lui...@gm...> - 2019-04-26 13:34:28
|
What version of the examples? In the most recent one, a few of the input rates are negatives and log-linear interpolation can't handle them. Luigi On Tue, Apr 9, 2019 at 9:31 AM R S <raj...@ho...> wrote: > Yes - I get an error on certain combinations of Trait and. Interpolator > > For example, with a declaration of PiecewiseYieldCurve<ForwardRate, > BackwardFlat>, I can get a dump of dates and rates from the curve > > However, if I. change the declaration to PiecewiseYieldCurve<ForwardRate, > LogLinear>, I get this error: > > terminate called after throwing an instance of 'QuantLib::Error' > what(): 1st iteration: failed at 1st alive instrument, pillar September > 29th, 2004, maturity September 29th, 2004, reference date September 22nd, > 2004: invalid value (-1) at index 0 > > Process finished with exit code 134 (interrupted by signal 6: SIGABRT) > > The data is based on the DepoSwap example from the Quantlib Examples > > > Regards > -RS > On 8 Apr 2019, 16:42 +0100, Luigi Ballabio <lui...@gm...>, > wrote: > > Yes, the bootstrap is done when the curve is first used. That would be > when it's first asked for rates or discounts during swap valuation. > > What do you mean when you say that some combinations don't work? Do you > get a compile-time error, or does the bootstrap fail at run-time? > > Luigi > > > On Wed, Mar 27, 2019 at 10:18 PM R S <raj...@ho...> wrote: > >> 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? >> >> >> |