28#ifndef ql_probability_traits_hpp
29#define ql_probability_traits_hpp
31#include <ql/termstructures/credit/interpolatedsurvivalprobabilitycurve.hpp>
32#include <ql/termstructures/credit/interpolatedhazardratecurve.hpp>
33#include <ql/termstructures/credit/interpolateddefaultdensitycurve.hpp>
34#include <ql/termstructures/bootstraphelper.hpp>
46 template <
class Interpolator>
76 Date d = c->dates()[i];
77 return c->survivalProbability(d,
true);
87 return c->data().back()/2.0;
89 Time dt = c->times()[i] - c->times()[i-1];
99 return c->data()[i-1];
117 template <
class Interpolator>
147 Date d = c->dates()[i];
148 return c->hazardRate(d,
true);
159 Real r = *(std::min_element(c->data().begin(), c->data().end()));
171 Real r = *(std::max_element(c->data().begin(), c->data().end()));
194 template <
class Interpolator>
223 Date d = c->dates()[i];
224 return c->defaultDensity(d,
true);
235 Real r = *(std::min_element(c->data().begin(), c->data().end()));
247 Real r = *(std::max_element(c->data().begin(), c->data().end()));
Base helper class for bootstrapping.
Default probability term structure.
DefaultProbabilityTermStructure based on interpolation of default densities.
DefaultProbabilityTermStructure based on interpolation of hazard rates.
DefaultProbabilityTermStructure based on interpolation of survival probabilities.
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
Real Time
continuous quantity with 1-year units
Real Probability
probability
std::size_t Size
size of a container
InterpolatedDefaultDensityCurve< Interpolator > type
Default-density-curve traits.
BootstrapHelper< DefaultProbabilityTermStructure > helper
static Real maxValueAfter(Size i, const C *c, bool validData, Size)
static Real guess(Size i, const C *c, bool validData, Size)
static Real initialValue(const DefaultProbabilityTermStructure *)
static Real minValueAfter(Size i, const C *c, bool validData, Size)
static Date initialDate(const DefaultProbabilityTermStructure *c)
static Size maxIterations()
static void updateGuess(std::vector< Real > &data, Real density, Size i)
InterpolatedHazardRateCurve< Interpolator > type
Hazard-rate-curve traits.
static void updateGuess(std::vector< Real > &data, Real rate, Size i)
BootstrapHelper< DefaultProbabilityTermStructure > helper
static Real maxValueAfter(Size i, const C *c, bool validData, Size)
static Real guess(Size i, const C *c, bool validData, Size)
static Real initialValue(const DefaultProbabilityTermStructure *)
static Real minValueAfter(Size i, const C *c, bool validData, Size)
static Date initialDate(const DefaultProbabilityTermStructure *c)
static Size maxIterations()
InterpolatedSurvivalProbabilityCurve< Interpolator > type
Survival-Probability-curve traits.
BootstrapHelper< DefaultProbabilityTermStructure > helper
static Real maxValueAfter(Size i, const C *c, bool validData, Size)
static void updateGuess(std::vector< Real > &data, Probability p, Size i)
static Real guess(Size i, const C *c, bool validData, Size)
static Real initialValue(const DefaultProbabilityTermStructure *)
static Real minValueAfter(Size i, const C *c, bool validData, Size)
static Date initialDate(const DefaultProbabilityTermStructure *c)
static Size maxIterations()