Posted by
animesh on
Jul 11, 2010; 12:06am
URL: http://quantlib.414.s1.nabble.com/Survival-Probability-tp13339.html
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