35 index_(
std::move(index)), initialValues_(
size_), fixingTimes_(
size_), fixingDates_(
size_),
36 accrualStartTimes_(size), accrualEndTimes_(size), accrualPeriod_(
size_), m1(
size_),
44 Date settlement =
index_->forwardingTermStructure()->referenceDate();
45 const Date startDate =
46 ext::dynamic_pointer_cast<IborCoupon>(flows[0])->fixingDate();
49 const ext::shared_ptr<IborCoupon> coupon =
50 ext::dynamic_pointer_cast<IborCoupon>(flows[i]);
52 QL_REQUIRE(coupon->date() == coupon->accrualEndDate(),
53 "irregular coupon types are not suppported");
60 dayCounter.
yearFraction(startDate, coupon->fixingDate());
62 dayCounter.
yearFraction(settlement,coupon->accrualStartDate());
64 dayCounter.
yearFraction(settlement,coupon->accrualEndDate());
69 const Array& x)
const {
97 tmp[k] = x0[k] * std::exp(dx[k]);
119 const Real sdt = std::sqrt(dt);
133 const Real r = std::inner_product(
136 const Real x =
y*std::exp(
d +
r);
138 f[k] = x0[k] * std::exp(0.5*(
d+
152 const ext::shared_ptr<LfmCovarianceParameterization> & param) {
156 ext::shared_ptr<LfmCovarianceParameterization>
161 ext::shared_ptr<IborIndex>
168 Date refDate =
index_->forwardingTermStructure()->referenceDate();
173 index_->businessDayConvention(),
174 index_->businessDayConvention(),
199 const std::vector<Time> &
204 const std::vector<Time> &
215 const std::vector<Rate> & rates)
const {
217 std::vector<DiscountFactor> discountFactors(
size_);
225 return discountFactors;
Cash-flow analysis functions.
Cash flow vector builders.
1-D array used in linear algebra.
const_iterator begin() const
Time yearFraction(const Date &, const Date &, const Date &refPeriodStart=Date(), const Date &refPeriodEnd=Date()) const
Returns the period between two dates as a fraction of year.
Euler discretization for stochastic processes.
helper class building a sequence of capped/floored ibor-rate coupons
IborLeg & withPaymentAdjustment(BusinessDayConvention)
IborLeg & withPaymentDayCounter(const DayCounter &)
IborLeg & withNotionals(Real notional)
IborLeg & withFixingDays(Natural fixingDays)
Array drift(Time t, const Array &x) const override
returns the drift part of the equation, i.e.,
Size size() const override
returns the number of dimensions of the stochastic process
Leg cashFlows(Real amount=1.0) const
Array evolve(Time t0, const Array &x0, Time dt, const Array &dw) const override
const std::vector< Time > & fixingTimes() const
std::vector< Date > fixingDates_
const ext::shared_ptr< IborIndex > index_
ext::shared_ptr< LfmCovarianceParameterization > lfmParam_
Matrix diffusion(Time t, const Array &x) const override
returns the diffusion part of the equation, i.e.
std::vector< Time > accrualPeriod_
const std::vector< Time > & accrualEndTimes() const
Size factors() const override
returns the number of independent factors of the process
ext::shared_ptr< LfmCovarianceParameterization > covarParam() const
std::vector< Time > accrualEndTimes_
Matrix covariance(Time t0, const Array &x0, Time dt) const override
const std::vector< Time > & accrualStartTimes() const
Size nextIndexReset(Time t) const
LiborForwardModelProcess(Size size, ext::shared_ptr< IborIndex > index)
Array initialValues() const override
returns the initial values of the state variables
std::vector< Time > fixingTimes_
std::vector< DiscountFactor > discountBond(const std::vector< Rate > &rates) const
void setCovarParam(const ext::shared_ptr< LfmCovarianceParameterization > ¶m)
Array apply(const Array &x0, const Array &dx) const override
const std::vector< Date > & fixingDates() const
ext::shared_ptr< IborIndex > index() const
std::vector< Time > accrualStartTimes_
Matrix used in linear algebra.
const_row_iterator row_begin(Size i) const
const_column_iterator column_begin(Size i) const
const_row_iterator row_end(Size i) const
discretization of a stochastic process over a given time interval
multi-dimensional stochastic process class.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Euler discretization for stochastic processes.
Coupon paying a variable index-based rate.
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Coupon paying a Libor-type index.
stochastic process of a libor forward model
std::vector< ext::shared_ptr< CashFlow > > Leg
Sequence of cash-flows.
ext::shared_ptr< YieldTermStructure > r
Interest-rate term structure.