27#ifndef quantlib_piecewise_default_curve_hpp
28#define quantlib_piecewise_default_curve_hpp
53 template <
class Traits,
class Interpolator,
54 template <
class>
class Bootstrap = IterativeBootstrap>
56 :
public Traits::template curve<Interpolator>::type,
59 typedef typename Traits::template curve<Interpolator>::type
base_curve;
69 const Date& referenceDate,
70 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
73 const std::vector<Date>& jumpDates = {},
74 const Interpolator& i = {},
76 :
base_curve(referenceDate, dayCounter, jumps, jumpDates, i),
83 const Date& referenceDate,
84 const std::vector<ext::shared_ptr<typename Traits::helper> >&
87 const Interpolator& i,
96 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
109 std::vector<ext::shared_ptr<typename Traits::helper> > instruments,
112 const std::vector<Date>& jumpDates = {},
113 const Interpolator& i = {},
115 :
base_curve(settlementDays, calendar, dayCounter, jumps, jumpDates, i),
124 const std::vector<ext::shared_ptr<typename Traits::helper> >&
127 const Interpolator& i,
129 :
base_curve(settlementDays, calendar, dayCounter,
138 const std::vector<ext::shared_ptr<typename Traits::helper> >&
142 :
base_curve(settlementDays, calendar, dayCounter),
158 const Date& referenceDate,
159 const std::vector<ext::shared_ptr<typename Traits::helper> >& instruments,
161 const ext::shared_ptr<OneFactorAffineModel>& model,
162 const Interpolator& i = {},
180 const std::vector<Time>&
times()
const;
181 const std::vector<Date>&
dates()
const;
182 const std::vector<Real>&
data()
const;
183 std::vector<std::pair<Date, Real> >
nodes()
const;
214 template <
class C,
class I,
template <
class>
class B>
217 return base_curve::maxDate();
220 template <
class C,
class I,
template <
class>
class B>
221 inline const std::vector<Time>&
224 return base_curve::times();
227 template <
class C,
class I,
template <
class>
class B>
228 inline const std::vector<Date>&
231 return base_curve::dates();
234 template <
class C,
class I,
template <
class>
class B>
235 inline const std::vector<Real>&
241 template <
class C,
class I,
template <
class>
class B>
242 inline std::vector<std::pair<Date, Real> >
245 return base_curve::nodes();
248 template <
class C,
class I,
template <
class>
class B>
257 this->updated_ =
false;
260 template <
class C,
class I,
template <
class>
class B>
264 return base_curve::survivalProbabilityImpl(
t);
267 template <
class C,
class I,
template <
class>
class B>
270 return base_curve::defaultDensityImpl(
t);
273 template <
class C,
class I,
template <
class>
class B>
276 return base_curve::hazardRateImpl(
t);
279 template <
class C,
class I,
template <
class>
class B>
282 bootstrap_.calculate();
Shared handle to an observable.
Framework for calculation on demand and result caching.
Piecewise default-probability term structure.
Real defaultDensityImpl(Time) const override
void performCalculations() const override
PiecewiseDefaultCurve(Natural settlementDays, const Calendar &calendar, const std::vector< ext::shared_ptr< typename Traits::helper > > &instruments, const DayCounter &dayCounter, const Interpolator &i, const bootstrap_type &bootstrap=bootstrap_type())
Traits::template curve< Interpolator >::type base_curve
Real hazardRateImpl(Time) const override
PiecewiseDefaultCurve< Traits, Interpolator, Bootstrap > this_curve
PiecewiseDefaultCurve(const Date &referenceDate, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, const std::vector< Handle< Quote > > &jumps={}, const std::vector< Date > &jumpDates={}, const Interpolator &i={}, bootstrap_type bootstrap={})
Bootstrap< this_curve > bootstrap_
const std::vector< Date > & dates() const
PiecewiseDefaultCurve(Natural settlementDays, const Calendar &calendar, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, const std::vector< Handle< Quote > > &jumps={}, const std::vector< Date > &jumpDates={}, const Interpolator &i={}, bootstrap_type bootstrap={})
PiecewiseDefaultCurve(Natural settlementDays, const Calendar &calendar, const std::vector< ext::shared_ptr< typename Traits::helper > > &instruments, const DayCounter &dayCounter, const bootstrap_type &bootstrap)
const std::vector< Real > & data() const
std::vector< std::pair< Date, Real > > nodes() const
Interpolator interpolator_type
PiecewiseDefaultCurve(const Date &referenceDate, const std::vector< ext::shared_ptr< typename Traits::helper > > &instruments, const DayCounter &dayCounter, const Interpolator &i, const bootstrap_type &bootstrap=bootstrap_type())
const std::vector< Time > & times() const
std::vector< ext::shared_ptr< typename Traits::helper > > instruments_
Probability survivalProbabilityImpl(Time) const override
Date maxDate() const override
PiecewiseDefaultCurve(const Date &referenceDate, std::vector< ext::shared_ptr< typename Traits::helper > > instruments, const DayCounter &dayCounter, bootstrap_type bootstrap)
PiecewiseDefaultCurve(const Date &referenceDate, const std::vector< ext::shared_ptr< typename Traits::helper > > &instruments, const DayCounter &dayCounter, const ext::shared_ptr< OneFactorAffineModel > &model, const Interpolator &i={}, const bootstrap_type &bootstrap={})
friend class Bootstrap< this_curve >
Bootstrap< this_curve > bootstrap_type
Real Time
continuous quantity with 1-year units
unsigned QL_INTEGER Natural
positive integer
Real Probability
probability
universal piecewise-term-structure boostrapper.
framework for calculation on demand and result caching
Abstract one-factor interest rate model class.
default-probability bootstrap traits
purely virtual base class for market observables