Re: CDS example

Posted by japari on
URL: http://quantlib.414.s1.nabble.com/CDS-example-tp11892p11893.html

Hi Luca, I am aware of the problem. It is the class IterativeBootstrap that
performs the test. Maybe it should delegate it. I made a temporary change on the
code and I could calibrate to one instrument (but I did not want to break all
the bootstrappers so I could not keep it :-)

True, in this case one instrument should be enough for *any* interpolation since
we should have an extra point for todays date but no instrument associated with
it. The value of the probability at that point depends on the value associated
to the one at the date of the intrument, on the probability model and on the
interpolator. (Plays the role of DF(t=0)=1 if you want).

As you say in the backwardflat case is more evident but independently of the
interpolator the region from t=0 to the first point should always be covered (we
might want to price an instruments with monthly payments) even when calling the
interpolator with the extrapoltaion "off".

The test (in "IterativeBootstrap<Curve>::setup"):
        Size n = ts_->instruments_.size();
        QL_REQUIRE(n >= Interpolator::requiredPoints, (...)

makes the comparison with the number of instruments and not with the number of
points in the bootstrapped curve (not necessarily the same number) We might fix
it asking the term structure and not counting the instruments; "setup" is called
right at the end of the calibrated term structure constructor and we have a ptr
to it. I havent done this myself since it affects all bootstrappers and need to
test a lot after it.

To be honest I havent finish going through the last commit of the code, I am
still modifying my client code to test the bootstrapping.

Regards, sorry for the long reply.

PP

Quoting Luca Billi <[hidden email]>:

> Hi all,
>
> I'm looking at the CDS example in the repository and I see that the
> bootstraping scheme
> doesn't work if I use only one calibrating instrument.
> The exception thrown says it needs at least 2 instruments.
>
> Is this the expected behavior?
>
> The error is caused by the BackwardFlat interpolation class requiring 2
> points.
> Technically, for flat interpolation one point might be enough.
>
> Thanks,
>
> Luca
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev