Login  Register

Re: [Quantlib-dev] Fwd: Re: CreditDefaultSwap throws RuntimeError

Posted by japari on Oct 05, 2009; 11:30am
URL: http://quantlib.414.s1.nabble.com/Fwd-Re-CreditDefaultSwap-throws-RuntimeError-tp8028p8032.html

Quoting Luigi Ballabio <[hidden email]>:

> On Mon, 2009-10-05 at 11:31 +0200, Jose Aparicio-Navarro wrote:
> > Quoting Luigi Ballabio <[hidden email]>:
> > Yep, lets make it the TS ref date. Moving this
> >
> > Date effectiveStartDate =
> >    (startDate <= today && today <= endDate) ? today : startDate;
> >
> > into:
> >
> > Date effectiveStartDate =
> >     (startDate <= settlementDate && settlementDate <= endDate) ?
> >         settlementDate : startDate;
> >
> > works for both cds engines.
>
> Except I'd leave the start date alone and correct the default date
> instead, if possible. No?
>
> Luigi
>
Right, not to mix things. But theres a potential problem with

Probability P = probability_->defaultProbability(
                    effectiveStartDate, ///<<<<<
                    endDate);
if "effectiveStartDate" lies before the probability curve reference date (I am
thinking: startAccrual < refProb < refTS < endAccrual). Now negative times come
from the probability TS instead.
We can add :

defaultEffectiveStartPeriod =
    effectiveStartDate < refProb ? refProb : effectiveStartDate;

Regards
Pepe

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users