From: Luigi Ballabio <[hidden email]>
To: Jose Aparicio-Navarro <[hidden email]>
Cc: Chris Kenyon <[hidden email]>; Roland Lichters
<[hidden email]>; Simon Ibbotson <[hidden email]>; [hidden email]; [hidden email]
Sent: Friday, February 20, 2009 5:15:20 PM
Subject: Re: [Quantlib-dev] credit modeling, Issuer, etc.
On Fri, 2009-02-20 at 08:30 +0100, Jose Aparicio-Navarro wrote:
> The other subject was the data structure, am I the only one having a problem
> with a one to one reltaion between issuer and recovery?
No, you're not the only one. The data structure is wrong.
However, I'm not sure that I would commit to a given class interface at
this time. It would probably take some trials to get it right, and
since I'd like to get release 1.0 out in a few months (and doing so, to
freeze the existing interfaces) I don't think we have the time for that.
Then again, the current Issuer class is wrong and should not go into
release 1.0 either. What I would do at this time is to remove the class
from the library and pass its components to the methods that were
accepting it. For instance, instead of
MidPointCdsEngine(const Issuer& issuer,
const Handle<YieldTermStructure>& discountCurve);
I would write
MidPointCdsEngine(
const Handle<DefaultProbabilityTermStructure>& probability,
Real recoveryRate,
const Handle<YieldTermStructure>& discountCurve,
const std::vector<boost::shared_ptr<DefaultEvent> >& events);
which is no longer so wrong---it just assumes that the correct
probability curve and recovery rate were chosen externally. Once we
experiment a bit and settle on an Issuer design, we can add the old
constructor back without breaking existing code.
Thoughts?
Luigi
--
Every solution breeds new problems.
-- unknown