Login  Register

Re: Survival Probability

Posted by japari on Jul 11, 2010; 9:58am
URL: http://quantlib.414.s1.nabble.com/Survival-Probability-tp13339p13340.html

Hi,
DefaultDensityStructure does not rely on a hazard rate model to compute the probabilities. You might well have other ways to compute them. Dont be confused by the methods in the parent class, you can still compute the rates. But see that
DefaultDensityStructure::defaultDensityImpl
does need to be making any reference to a HR model. Its more 'abstract' conceptually

The more specialized class and method:
HazardRateStructure::survivalProbabilityImpl
is what you have in mind.

Hope it helps.
Pepe


----- Mail Original -----
De: "animesh saxena" <[hidden email]>
À: [hidden email]
Envoyé: Samedi 10 Juillet 2010 17h06:02 GMT -08:00 Tijuana / Baja California
Objet: [Quantlib-dev] Survival Probability

Minor doubt in defaultdensitystructure.cpp

In the function
 Probability DefaultDensityStructure::survivalProbabilityImpl(Time t)
const {
        static GaussChebyshevIntegration integral(48);
        // this stores the address of the method to integrate (so that
        // we don't have to insert its full expression inside the
        // integral below--it's long enough already)
        Real (DefaultDensityStructure::*f)(Time) const =
            &DefaultDensityStructure::defaultDensityImpl;
        // the Gauss-Chebyshev quadratures integrate over [-1,1],
        // hence the remapping (and the Jacobian term t/2)
        Probability P = 1.0 - integral(remap(bind(f,this,_1), t)) * t/2.0;
        //QL_ENSURE(P >= 0.0, "negative survival probability");
        return std::max<Real>(P, 0.0);
    }

The following code is present. If lambda is constant then survival
probability is exp(-lambda * t)
If not then we integrate to find lambda over [0,t] and it becomes
exp(Integral over [0,t] lambda dt)

In the code it looks like it is calculating default probability which is
1 - P or 1 - Survival Probability.
Maybe my understanding is wrong. Can someone explain?


        Probability P = 1.0 - integral(remap(bind(f,this,_1), t)) * t/2.0;


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev