20#ifndef onefactor_affine_survival_hpp
21#define onefactor_affine_survival_hpp
46 ext::shared_ptr<OneFactorAffineModel> model,
49 const std::vector<Date>&
jumpDates = std::vector<Date>())
53 ext::shared_ptr<OneFactorAffineModel> model,
58 const std::vector<Date>&
jumpDates = std::vector<Date>())
63 ext::shared_ptr<OneFactorAffineModel> model,
68 const std::vector<Date>&
jumpDates = std::vector<Date>())
104 bool extrapolate =
false)
const {
110 bool extrapolate =
false)
const
112 #if defined(QL_EXTRA_SAFETY_CHECKS)
113 QL_REQUIRE(tgt >= tFwd,
"Incorrect dates ordering.");
145 ext::shared_ptr<OneFactorAffineModel>
model_;
153 model_->dynamics()->shortRate(0.,
154 model_->dynamics()->process()->x0());
156 return model_->discountBond(0.,
t, initValHR);
162 return model_->discountBond(tFwd, tgt, yVal);
168 model_->dynamics()->shortRate(0.,
169 model_->dynamics()->process()->x0());;
172 model_->discountBond(0.,
t, initValHR);
static Date maxDate()
latest allowed date
Rate hazardRate(const Date &d, bool extrapolate=false) const
const std::vector< Date > & jumpDates() const
Shared handle to an observable.
Hazard-rate term structure.
Real defaultDensityImpl(Time) const override
default density calculation
OneFactorAffineSurvivalStructure(ext::shared_ptr< OneFactorAffineModel > model, const DayCounter &dayCounter=DayCounter(), const std::vector< Handle< Quote > > &jumps=std::vector< Handle< Quote > >(), const std::vector< Date > &jumpDates=std::vector< Date >())
Probability conditionalSurvivalProbability(const Date &dFwd, const Date &dTgt, Real yVal, bool extrapolate=false) const
Real hazardRateImpl(Time) const override
hazard rate calculation
Probability conditionalSurvivalProbability(Time tFwd, Time tgt, Real yVal, bool extrapolate=false) const
virtual Probability conditionalSurvivalProbabilityImpl(Time tFwd, Time tgt, Real yVal) const
ext::shared_ptr< OneFactorAffineModel > model_
OneFactorAffineSurvivalStructure(ext::shared_ptr< OneFactorAffineModel > model, Natural settlementDays, const Calendar &calendar, const DayCounter &dayCounter=DayCounter(), const std::vector< Handle< Quote > > &jumps=std::vector< Handle< Quote > >(), const std::vector< Date > &jumpDates=std::vector< Date >())
Probability survivalProbabilityImpl(Time) const override
survival probability calculation
Date maxDate() const override
the latest date for which the curve can return values
OneFactorAffineSurvivalStructure(ext::shared_ptr< OneFactorAffineModel > model, const Date &referenceDate, const Calendar &cal=Calendar(), const DayCounter &dayCounter=DayCounter(), const std::vector< Handle< Quote > > &jumps=std::vector< Handle< Quote > >(), const std::vector< Date > &jumpDates=std::vector< Date >())
Rate hazardRate(Time t, bool extrapolate=false) const
virtual Natural settlementDays() const
the settlementDays used for reference date calculation
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Calendar calendar() const
the calendar used for reference and/or option date calculation
Time timeFromReference(const Date &date) const
date/time conversion
void checkRange(const Date &d, bool extrapolate) const
date-range check
virtual DayCounter dayCounter() const
the day counter used for date/time conversion
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Probability
probability
hazard-rate term structure
Abstract one-factor interest rate model class.