|
From: Luigi B. <lui...@gm...> - 2020-11-29 08:58:03
|
Hello,
the problem is not the negative value per se. By passing [0, -1, 1]
and simple compounding, you're passing a -100% rate for the first year,
which results in the discount at one year being 0. This is what the curve
is rejecting. If you wanted to pass -1%, the correct value is -0.01.
Luigi
On Sun, Nov 29, 2020 at 9:19 AM Daniel Lobo <dan...@gm...> wrote:
> Hi,
>
> It appears like QL is failing to construct a term structure when some
> spot-rates are supplied with Negative value. Below is my calculation -
>
> from QuantLib import *
>
> ZeroCurve([Date(1, 1, 2010), Date(1, 1, 2011), Date(1, 1, 2012)], [0,
> -1, 1],Actual360(), UnitedStates(), Linear(), Simple)
>
> WIth this, the error I obtained as -
>
> File "<stdin>", line 1, in <module>
>
> File "QuantLib.py", line 24534, in __init__
>
> _QuantLib.ZeroCurve_swiginit(self, _QuantLib.new_ZeroCurve(*args))
>
> RuntimeError: positive compound factor required
>
> Your advice on how to handle this situation will be very appreciated.
>
> Thanks for your time.
>
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|