28 const ext::shared_ptr<YoYInflationIndex>& yii,
34 const std::vector<Rate>& cStrikes,
35 const std::vector<Rate>& fStrikes,
36 const std::vector<Period>& cfMaturities,
40 fixingDays_(fixingDays), bdc_(bdc), yoyIndex_(yii), observationLag_(lag), nominalTS_(
std::move(nominal)),
41 cStrikes_(cStrikes), fStrikes_(fStrikes), cfMaturities_(cfMaturities), cPrice_(cPrice),
42 fPrice_(fPrice), indexIsInterpolated_(yii->interpolated()) {
49 "floor strikes vs floor price rows not equal");
51 "cap strikes vs cap price rows not equal");
53 "maturities vs floor price columns not equal");
55 "maturities vs cap price columns not equal");
61 QL_REQUIRE( cfMaturities[j] > cfMaturities[j-1],
62 "non-increasing maturities");
66 "non-positive floor price: " <<
fPrice_[i][j] );
69 "non-increasing floor prices");
74 "non-positive cap price: " <<
cPrice_[i][j] );
77 "non-decreasing cap prices");
93 if (k > maxFstrike + eps)
cfStrikes_.push_back(k);
100 "cfStrikes not increasing");
121 bool extrapolate)
const {
127 bool extrapolate)
const {
Shared handle to an observable.
Matrix used in linear algebra.
Basic term-structure functionality.
virtual const Date & referenceDate() const
the date at which discount = 1.0 and/or variance = 0.0
virtual Real price(const Date &d, Rate k) const =0
virtual Rate atmYoYRate(const Date &d, const Period &obsLag=Period(-1, Days), bool extrapolate=true) const =0
std::vector< Rate > cfStrikes_
std::vector< Period > cfMaturities_
std::vector< Rate > fStrikes_
std::vector< Rate > cStrikes_
YoYCapFloorTermPriceSurface(Natural fixingDays, const Period &yyLag, const ext::shared_ptr< YoYInflationIndex > &yii, Rate baseRate, Handle< YieldTermStructure > nominal, const DayCounter &dc, const Calendar &cal, const BusinessDayConvention &bdc, const std::vector< Rate > &cStrikes, const std::vector< Rate > &fStrikes, const std::vector< Period > &cfMaturities, const Matrix &cPrice, const Matrix &fPrice)
virtual Real capPrice(const Date &d, Rate k) const =0
virtual Rate atmYoYSwapRate(const Date &d, bool extrapolate=true) const =0
virtual Real floorPrice(const Date &d, Rate k) const =0
virtual Date yoyOptionDateFromTenor(const Period &p) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
BusinessDayConvention
Business Day conventions.
unsigned QL_INTEGER Natural
positive integer
std::size_t Size
size of a container
yoy inflation cap and floor term-price structure