39#include <ql/cashflows/yoyinflationcoupon.hpp>
40#include <ql/pricingengines/swap/discountingswapengine.hpp>
41#include <ql/time/daycounters/thirty360.hpp>
42#include <boost/range/join.hpp>
54using QuantLib::DiscountingSwapEngine;
55using QuantLib::Thirty360;
56using QuantLib::YoYInflationCoupon;
57using std::lower_bound;
65 bool operator() (QuantLib::Time s, QuantLib::Time t)
const {
66 return s < t && !QuantLib::close(s, t);
78 const string& configuration,
const string& referenceCalibrationGrid,
79 const bool dontCalibrate)
80 : market_(market), configuration_(configuration), data_(
data), referenceCalibrationGrid_(referenceCalibrationGrid),
82 zeroInflationIndex_(*market_->zeroInflationIndex(data_->index(), configuration_)) {
84 LOG(
"InfJyBuilder: building model for inflation index " <<
data_->index());
98 alwaysForwardNotifications();
109 return data_->index();
128 return (
data_->realRateVolatility().calibrate() ||
data_->realRateReversion().calibrate() ||
129 data_->indexVolatility().calibrate()) &&
154 DLOG(
"InfJyBuilder: calibration type is None so no calibration baskets built.");
158 const auto& cbs =
data_->calibrationBaskets();
164 QL_REQUIRE(cbs.size() > 0,
"InfJyBuilder: calibration type is BestFit but no calibration baskets provided.");
167 if (cbs.size() > 1) {
172 WLOG(
"InfJyBuilder: only 2 calibration baskets can be processed but " << cbs.size() <<
173 " were supplied. The extra baskets are ignored.");
179 "type to be one of None, BestFit or Bootstrap.");
188 DLOG(
"InfJyBuilder: building calibration basket for JY index bootstrap calibration.");
193 QL_REQUIRE(cbs.size() == 1,
"InfJyBuilder: calibrating only JY index volatility using Bootstrap so " <<
194 "expected exactly one basket but got " << cbs.size() <<
".");
195 const auto& cb = cbs[0];
196 if (!cb.parameter().empty() && cb.parameter() !=
"Index") {
197 WLOG(
"InfJyBuilder: calibrating only JY index volatility using Bootstrap so expected the " <<
198 "calibration basket parameter to be 'Index' but got '" << cb.parameter() <<
"'.");
203 DLOG(
"InfJyBuilder: need a calibration basket with parameter equal to 'Index'.");
213 DLOG(
"InfJyBuilder: building calibration basket for JY real rate bootstrap calibration.");
214 QL_REQUIRE(!(rrReversion.
calibrate() && rrVolatility.
calibrate()),
"InfJyBuilder: calibrating both the " <<
215 "real rate reversion and real rate volatility using Bootstrap is not supported.");
220 QL_REQUIRE(cbs.size() == 1,
"InfJyBuilder: calibrating only JY real rate using Bootstrap so " <<
221 "expected exactly one basket but got " << cbs.size() <<
".");
222 const auto& cb = cbs[0];
223 if (!cb.parameter().empty() && cb.parameter() !=
"RealRate") {
224 WLOG(
"InfJyBuilder: calibrating only JY real rate using Bootstrap so expected the " <<
225 "calibration basket parameter to be 'RealRate' but got '" << cb.parameter() <<
"'.");
227 rrInstActive_ = vector<bool>(cb.instruments().size(),
false);
230 DLOG(
"InfJyBuilder: need a calibration basket with parameter equal to 'RealRate'.");
232 rrInstActive_ = vector<bool>(cb.instruments().size(),
false);
240 vector<bool>& active, Array& expiries,
bool forRealRateReversion)
const {
242 QL_REQUIRE(!cb.
empty(),
"InfJyBuilder: calibration basket should not be empty.");
245 QL_REQUIRE(ci.size() == active.size(),
"InfJyBuilder: expected the active instruments vector " <<
246 "size to equal the number of calibration instruments");
247 fill(active.begin(), active.end(),
false);
256 QL_FAIL(
"InfJyBuilder: expected calibration instrument to be one of CpiCapFloor, YoYCapFloor or YoYSwap");
261 vector<bool>& active, Array& expiries)
const {
263 DLOG(
"InfJyBuilder: start building the CPI cap floor calibration basket.");
265 QL_REQUIRE(!
cpiVolatility_.empty(),
"InfJyBuilder: need a non-empty CPI cap floor volatility structure " <<
266 "to build a CPI cap floor calibration basket.");
277 QuantLib::ext::shared_ptr<QuantExt::CPICapFloorEngine> engine;
279 if (isLogNormalVol) {
288 auto baseDate = zts->baseDate();
294 Date today = Settings::instance().evaluationDate();
298 set<Time, CloseCmp> expiryTimes;
303 auto prevRcDate = Date::minDate();
308 auto observationInterpolation =
cpiVolatility_->indexIsInterpolated() ? CPI::Linear : CPI::Flat;
310 for (Size i = 0; i < ci.size(); ++i) {
312 auto cpiCapFloor = QuantLib::ext::dynamic_pointer_cast<CpiCapFloor>(ci[i]);
313 QL_REQUIRE(cpiCapFloor,
"InfJyBuilder: expected CpiCapFloor calibration instrument.");
317 auto rcDate = lower_bound(rcDates.begin(), rcDates.end(),
maturity);
318 if (!(rcDate == rcDates.end() || *rcDate > prevRcDate)) {
323 if (rcDate != rcDates.end())
324 prevRcDate = *rcDate;
332 Option::Type capfloor = cpiCapFloor->type() == CapFloor::Cap ? Option::Call : Option::Put;
333 auto inst = QuantLib::ext::make_shared<CPICapFloor>(capfloor, nominal, today, baseCpi,
maturity,
calendar, bdc,
calendar, bdc,
335 inst->setPricingEngine(engine);
347 premium = inst->NPV();
351 observationInterpolation);
354 if (t < 0.0 || QuantLib::close_enough(t, 0.0) || QuantLib::close_enough(premium, 0.0)) {
359 auto p = expiryTimes.insert(t);
360 QL_REQUIRE(
data_->ignoreDuplicateCalibrationExpiryTimes() || p.second,
361 "InfJyBuilder: a CPI cap floor calibration "
362 <<
"instrument with the expiry time, " << t <<
", was already added.");
365 helpers.push_back(
helper);
367 TLOG(
"InfJyBuilder: " << (p.second ?
368 "added CPICapFloor helper" :
369 "skipped CPICapFloor helper due to duplicate expiry time (" + std::to_string(t) +
")") <<
370 ": index = " <<
data_->index() <<
371 ", type = " << cpiCapFloor->type() <<
372 ", expiry = " << io::iso_date(
maturity) <<
373 ", base CPI = " << baseCpi <<
374 ", strike = " << strikeValue <<
375 ", obs lag = " << obsLag <<
376 ", market premium = " << premium);
380 expiries = Array(expiryTimes.begin(), expiryTimes.end());
382 DLOG(
"InfJyBuilder: finished building the CPI cap floor calibration basket.");
389 DLOG(
"InfJyBuilder: start building the YoY cap floor calibration basket.");
392 QL_REQUIRE(
yoyInflationIndex_,
"InfJyBuilder: need a valid year on year inflation index "
393 <<
"to build a year on year cap floor calibration basket.");
395 QL_REQUIRE(!yoyTs.empty(),
"InfJyBuilder: need a valid year on year term structure "
396 <<
"to build a year on year cap floor calibration basket.");
397 QL_REQUIRE(!
yoyVolatility_.empty(),
"InfJyBuilder: need a valid year on year volatility "
398 <<
"structure to build a year on year cap floor calibration basket.");
407 QuantLib::ext::shared_ptr<PricingEngine> engine;
409 if (ovsType == Normal)
411 else if (ovsType == ShiftedLognormal && close(
yoyVolatility_->displacement(), 0.0))
413 else if (ovsType == ShiftedLognormal)
417 QL_FAIL(
"InfJyBuilder: can't create engine with yoy volatility type, " << ovsType <<
".");
421 Natural settlementDays = 2;
423 DayCounter dc = Thirty360(Thirty360::BondBasis);
424 auto bdc = Following;
428 set<Time, CloseCmp> expiryTimes;
433 auto prevRcDate = Date::minDate();
437 for (Size i = 0; i < ci.size(); ++i) {
439 auto yoyCapFloor = QuantLib::ext::dynamic_pointer_cast<YoYCapFloor>(ci[i]);
440 QL_REQUIRE(yoyCapFloor,
"InfJyBuilder: expected YoYCapFloor calibration instrument.");
444 Date today = Settings::instance().evaluationDate();
445 Date maturityDate =
calendar.advance(
calendar.advance(today, settlementDays * Days), yoyCapFloor->tenor(), bdc);
449 auto quote = QuantLib::ext::make_shared<SimpleQuote>(0.01);
450 auto helper = QuantLib::ext::make_shared<YoYCapFloorHelper>(Handle<Quote>(quote), yoyCapFloor->type(), strikeValue,
454 auto helperInst =
helper->yoyCapFloor();
455 auto maturity = helperInst->maturityDate();
456 auto rcDate = lower_bound(rcDates.begin(), rcDates.end(),
maturity);
457 if (!(rcDate == rcDates.end() || *rcDate > prevRcDate)) {
462 if (rcDate != rcDates.end())
463 prevRcDate = *rcDate;
466 helperInst->setPricingEngine(engine);
472 auto fixingDate = helperInst->lastYoYInflationCoupon()->fixingDate();
476 if (t < 0.0 || QuantLib::close_enough(t, 0.0)) {
481 auto p = expiryTimes.insert(t);
482 QL_REQUIRE(
data_->ignoreDuplicateCalibrationExpiryTimes() || p.second,
483 "InfJyBuilder: a YoY cap floor calibration "
484 <<
"instrument with the expiry time, " << t <<
", was already added.");
488 helpers.push_back(
helper);
490 TLOG(
"InfJyBuilder: " << (p.second ?
491 "added YoYCapFloor helper" :
492 "skipped YoYCapFloor helper due to duplicate expiry time (" + std::to_string(t) +
")") <<
493 ": index = " <<
data_->index() <<
494 ", type = " << yoyCapFloor->type() <<
495 ", expiry = " << io::iso_date(
maturity) <<
496 ", strike = " << strikeValue <<
497 ", obs lag = " << obsLag <<
498 ", market premium = " << quote->value());
502 expiries = Array(expiryTimes.begin(), expiryTimes.end());
504 DLOG(
"InfJyBuilder: finished building the YoY cap floor calibration basket.");
510 vector<bool>& active, Array& expiries,
bool forRealRateReversion)
const {
512 DLOG(
"InfJyBuilder: start building the YoY swap calibration basket.");
515 QL_REQUIRE(
yoyInflationIndex_,
"InfJyBuilder: need a valid year on year inflation index " <<
516 "to build a year on year swap calibration basket.");
518 QL_REQUIRE(!yoyTs.empty(),
"InfJyBuilder: need a valid year on year term structure " <<
519 "to build a year on year swap calibration basket.");
528 auto engine = QuantLib::ext::make_shared<DiscountingSwapEngine>(
rateCurve_);
533 Natural settlementDays = 2;
535 auto dc = Thirty360(Thirty360::BondBasis);
536 auto bdc = Following;
537 auto obsLag = yoyTs->observationLag();
540 set<Time, CloseCmp> expiryTimes;
545 auto prevRcDate = Date::minDate();
549 for (Size i = 0; i < ci.size(); ++i) {
551 auto yoySwap = QuantLib::ext::dynamic_pointer_cast<YoYSwap>(ci[i]);
552 QL_REQUIRE(yoySwap,
"InfJyBuilder: expected YoYSwap calibration instrument.");
555 auto quote = QuantLib::ext::make_shared<SimpleQuote>(0.01);
556 auto helper = QuantLib::ext::make_shared<YoYSwapHelper>(Handle<Quote>(quote), settlementDays, yoySwap->tenor(),
561 auto helperInst =
helper->yoySwap();
562 auto maturity = helperInst->maturityDate();
563 auto rcDate = lower_bound(rcDates.begin(), rcDates.end(),
maturity);
564 if (!(rcDate == rcDates.end() || *rcDate > prevRcDate)) {
569 if (rcDate != rcDates.end())
570 prevRcDate = *rcDate;
573 helperInst->setPricingEngine(engine);
576 quote->setValue(helperInst->fairRate());
587 QL_REQUIRE(!helperInst->yoyLeg().empty(),
"InfJyBuilder: expected YoYSwap to have non-empty YoY leg.");
588 auto finalYoYCoupon = QuantLib::ext::dynamic_pointer_cast<YoYInflationCoupon>(helperInst->yoyLeg().back());
589 Date numFixingDate = finalYoYCoupon->fixingDate();
590 if (forRealRateReversion) {
593 auto denFixingDate = numFixingDate - 1 * Years;
598 DLOG(
"The year on year swap with maturity tenor, " << yoySwap->tenor() <<
", and date, " <<
maturity <<
599 ", has a non-positive parameter time, " << t <<
", so skipping this as a calibration instrument.");
604 helpers.push_back(
helper);
606 auto p = expiryTimes.insert(t);
607 QL_REQUIRE(p.second,
"InfJyBuilder: a YoY swap calibration instrument with the expiry " <<
608 "time, " << t <<
", was already added.");
610 TLOG(
"InfJyBuilder: added year on year swap helper" <<
611 ": index = " <<
data_->index() <<
612 ", maturity = " << io::iso_date(
maturity) <<
613 ", obs lag = " << obsLag <<
614 ", market rate = " << quote->value());
618 expiries = Array(expiryTimes.begin(), expiryTimes.end());
620 DLOG(
"InfJyBuilder: finished building the YoY swap calibration basket.");
627 for (
const auto& cb :
data_->calibrationBaskets()) {
628 if (cb.parameter() == parameter) {
633 QL_FAIL(
"InfJyBuilder: unable to find calibration basket with parameter value equal to '" << parameter <<
"'.");
638 DLOG(
"InfJyBuilder: start creating the real rate parameterisation.");
643 Array rrVolatilityTimes(rrVolatility.
times().begin(), rrVolatility.
times().end());
644 Array rrVolatilityValues(rrVolatility.
values().begin(), rrVolatility.
values().end());
645 Array rrReversionTimes(rrReversion.
times().begin(), rrReversion.
times().end());
646 Array rrReversionValues(rrReversion.
values().begin(), rrReversion.
values().end());
657 const auto& cc =
data_->calibrationConfiguration();
658 auto rrVolConstraint = cc.constraint(
"RealRateVolatility");
659 auto rrRevConstraint = cc.constraint(
"RealRateReversion");
662 using QuantLib::ZeroInflationTermStructure;
663 QuantLib::ext::shared_ptr<QuantExt::Lgm1fParametrization<ZeroInflationTermStructure>> realRateParam;
666 DLOG(
"InfJyBuilder: real rate parameterization is Lgm1fPiecewiseConstantHullWhiteAdaptor");
667 realRateParam = QuantLib::ext::make_shared<Lgm1fPiecewiseConstantHullWhiteAdaptor<ZeroInflationTermStructure>>(
669 rrVolatilityValues, rrReversionTimes, rrReversionValues,
data_->index(), rrVolConstraint, rrRevConstraint);
672 DLOG(
"InfJyBuilder: real rate parameterization is Lgm1fPiecewiseConstantParametrization");
673 realRateParam = QuantLib::ext::make_shared<Lgm1fPiecewiseConstantParametrization<ZeroInflationTermStructure>>(
675 rrVolatilityValues, rrReversionTimes, rrReversionValues,
data_->index(), rrVolConstraint, rrRevConstraint);
678 DLOG(
"InfJyBuilder: real rate parameterization is Lgm1fPiecewiseLinearParametrization");
679 realRateParam = QuantLib::ext::make_shared<Lgm1fPiecewiseLinearParametrization<ZeroInflationTermStructure>>(
681 rrVolatilityValues, rrReversionTimes, rrReversionValues,
data_->index(), rrVolConstraint, rrRevConstraint);
683 QL_FAIL(
"InfJyBuilder: reversion type Hagan and volatility type HullWhite not supported.");
686 Time horizon =
data_->reversionTransformation().horizon();
687 if (horizon >= 0.0) {
688 DLOG(
"InfJyBuilder: apply shift horizon " << horizon <<
" to the JY real rate parameterisation for index " <<
689 data_->index() <<
".");
690 realRateParam->shift() = horizon;
692 WLOG(
"InfJyBuilder: ignoring negative horizon, " << horizon <<
693 ", passed to the JY real rate parameterisation for index " <<
data_->index() <<
".");
696 Real scaling =
data_->reversionTransformation().scaling();
698 DLOG(
"InfJyBuilder: apply scaling " << scaling <<
" to the JY real rate parameterisation for index " <<
699 data_->index() <<
".");
700 realRateParam->scaling() = scaling;
702 WLOG(
"Ignoring non-positive scaling, " << scaling <<
703 ", passed to the JY real rate parameterisation for index " <<
data_->index() <<
".");
706 DLOG(
"InfJyBuilder: finished creating the real rate parameterisation.");
708 return realRateParam;
713 DLOG(
"InfJyBuilder: start creating the index parameterisation.");
717 Array idxVolatilityTimes(idxVolatility.
times().begin(), idxVolatility.
times().end());
718 Array idxVolatilityValues(idxVolatility.
values().begin(), idxVolatility.
values().end());
724 QuantLib::ext::shared_ptr<QuantExt::FxBsParametrization> indexParam;
726 Handle<Quote> baseCpiQuote(QuantLib::ext::make_shared<SimpleQuote>(
731 const auto& cc =
data_->calibrationConfiguration();
732 auto idxVolConstraint = cc.constraint(
"IndexVolatility");
736 DLOG(
"InfJyBuilder: index volatility parameterization is FxBsPiecewiseConstantParametrization");
737 indexParam = QuantLib::ext::make_shared<FxBsPiecewiseConstantParametrization>(
738 zeroInflationIndex_->currency(), baseCpiQuote, idxVolatilityTimes, idxVolatilityValues, idxVolConstraint);
741 DLOG(
"InfJyBuilder: index volatility parameterization is FxBsConstantParametrization");
742 indexParam = QuantLib::ext::make_shared<FxBsConstantParametrization>(
745 QL_FAIL(
"InfJyBuilder: index volatility parameterization needs to be Piecewise or Constant.");
748 DLOG(
"InfJyBuilder: finished creating the index parameterisation.");
754 const Array& expiries,
const string& paramName)
const {
756 DLOG(
"InfJyBuilder: start setting up parameters for " << paramName);
759 QL_REQUIRE(param.
times().size() == 0,
"InfJyBuilder: parameter is constant so empty times expected");
760 QL_REQUIRE(param.
values().size() == 1,
"InfJyBuilder: parameter is constant so initial value array " <<
761 "should have 1 element.");
765 QL_REQUIRE(!expiries.empty(),
"InfJyBuilder: calibration instrument expiries are empty.");
766 QL_REQUIRE(!values.empty(),
"InfJyBuilder: expected at least one initial value.");
767 DLOG(
"InfJyBuilder: overriding initial times " << times <<
" with option calibration instrument " <<
768 "expiries " << expiries <<
".");
769 times = Array(expiries.begin(), expiries.end() - 1);
770 values = Array(times.size() + 1, values[0]);
772 QL_REQUIRE(values.size() == times.size() + 1,
"InfJyBuilder: size of values grid, " << values.size() <<
773 ", should be 1 greater than the size of the times grid, " << times.size() <<
".");
777 QL_FAIL(
"Expected " << paramName <<
" parameter to be Constant or Piecewise.");
780 DLOG(
"InfJyBuilder: finished setting up parameters for " << paramName);
791 TLOG(
"InfJyBuilder: finished building reference date grid.");
798 TLOG(
"InfJyBuilder: start initialising market data members.");
805 DLOG(
"InfJyBuilder: the market does not have a CPI cap floor volatility surface.");
812 DLOG(
"InfJyBuilder: the market does not have a YoY inflation index.");
818 DLOG(
"InfJyBuilder: the market does not have a YoY cap floor volatility surface.");
821 TLOG(
"InfJyBuilder: finished initialising market data members.");
836 priceCache_ = vector<Real>(numInsts, Null<Real>());
857 if (
auto h = QuantLib::ext::dynamic_pointer_cast<CpiCapFloorHelper>(
helper)) {
858 return h->marketValue();
861 if (
auto h = QuantLib::ext::dynamic_pointer_cast<YoYCapFloorHelper>(
helper)) {
862 return h->marketValue();
865 if (QuantLib::ext::shared_ptr<YoYSwapHelper> h = QuantLib::ext::dynamic_pointer_cast<YoYSwapHelper>(
helper)) {
866 return h->marketRate();
869 QL_FAIL(
"InfJyBuilder: unrecognised calibration instrument for JY calibration.");
virtual void forceRecalculate()
bool empty() const
Returns true if the calibration basket is empty.
const std::string & instrumentType() const
const std::vector< QuantLib::ext::shared_ptr< CalibrationInstrument > > & instruments() const
const std::vector< QuantLib::Date > & dates() const
Helpers buildCalibrationBasket(const CalibrationBasket &cb, std::vector< bool > &active, QuantLib::Array &expiries, bool forRealRateReversion=false) const
Build the calibration basket.
QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > zeroInflationIndex_
std::vector< QuantLib::ext::shared_ptr< QuantLib::CalibrationHelper > > Helpers
std::string configuration_
std::string referenceCalibrationGrid_
void forceRecalculate() override
QuantLib::ext::shared_ptr< Market > market_
void performCalculations() const override
Helpers indexBasket() const
Helpers buildYoYSwapBasket(const CalibrationBasket &cb, std::vector< bool > &active, QuantLib::Array &expiries, bool forRealRateReversion=false) const
Build a YoY swap calibration basket.
QuantLib::ext::shared_ptr< QuantExt::MarketObserver > marketObserver_
QuantLib::Handle< QuantLib::YoYOptionletVolatilitySurface > yoyVolatility_
const CalibrationBasket & calibrationBasket(const std::string ¶meter) const
Find calibration basket with parameter value equal to parameter.
void setCalibrationDone() const
Helpers buildYoYCapFloorBasket(const CalibrationBasket &cb, std::vector< bool > &active, QuantLib::Array &expiries) const
Build a YoY cap floor calibration basket.
void initialiseMarket()
Attempt to initialise market data members that may be needed for building calibration instruments.
QuantLib::ext::shared_ptr< QuantLib::YoYInflationIndex > yoyInflationIndex_
Helpers buildCpiCapFloorBasket(const CalibrationBasket &cb, std::vector< bool > &active, QuantLib::Array &expiries) const
Build a CPI cap floor calibration basket.
QuantLib::ext::shared_ptr< InfJyData > data_
QuantLib::ext::shared_ptr< QuantExt::InfJyParameterization > parameterization() const
bool requiresRecalibration() const override
QuantLib::ext::shared_ptr< QuantExt::Lgm1fParametrization< ZeroInflationTermStructure > > createRealRateParam() const
Create the real rate parameterisation.
Handle< YieldTermStructure > rateCurve_
void buildCalibrationBaskets() const
Build any calibration baskets requested by the configuration i.e. via the data_ member.
bool pricesChanged(bool updateCache) const
InfJyBuilder(const QuantLib::ext::shared_ptr< Market > &market, const QuantLib::ext::shared_ptr< InfJyData > &data, const std::string &configuration=Market::defaultConfiguration, const std::string &referenceCalibrationGrid="", const bool donCalibrate=false)
void setupParams(const ModelParameter ¶m, QuantLib::Array ×, QuantLib::Array &values, const QuantLib::Array &expiries, const std::string ¶mName) const
QuantLib::Array indexInstExpiries_
std::vector< bool > rrInstActive_
QuantLib::ext::shared_ptr< QuantExt::FxBsParametrization > createIndexParam() const
Create the inflation index parameterisation.
std::vector< QuantLib::Date > referenceCalibrationDates() const
Create the reference calibration dates.
std::string inflationIndex() const
QuantLib::ext::shared_ptr< QuantExt::InfJyParameterization > parameterization_
QuantLib::Array rrInstExpiries_
std::vector< QuantLib::Real > priceCache_
Cache the prices of all of the active calibration helper instruments.
Helpers realRateBasket() const
QuantLib::Real marketPrice(const QuantLib::ext::shared_ptr< QuantLib::CalibrationHelper > &helper) const
Return the market value of the given calibration helper.
std::vector< bool > indexInstActive_
QuantLib::Handle< QuantLib::CPIVolatilitySurface > cpiVolatility_
ReversionType
Supported mean reversion types.
VolatilityType
Supported volatility types.
const std::vector< QuantLib::Time > & times() const
const std::vector< QuantLib::Real > & values() const
LgmData::ReversionType reversionType() const
const boost::optional< LgmData::VolatilityType > & volatilityType() const
Builder for a Jarrow Yildrim inflation model component.
Classes and functions for log message handling.
#define LOG(text)
Logging Macro (Level = Notice)
#define DLOG(text)
Logging Macro (Level = Debug)
#define WLOG(text)
Logging Macro (Level = Warning)
#define TLOG(text)
Logging Macro (Level = Data)
class for holding details of a zero coupon CPI cap floor calibration instrument.
class for holding details of a year on year inflation cap floor calibration instrument.
Shared utilities for model building and calibration.
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
bool isCPIVolSurfaceLogNormal(const boost::shared_ptr< QuantLib::CPIVolatilitySurface > &surface)
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
Time inflationTime(const Date &date, const boost::shared_ptr< InflationTermStructure > &inflationTs, bool indexIsInterpolated, const DayCounter &dayCounter)
Real yoyCapFloorStrikeValue(const QuantLib::ext::shared_ptr< BaseStrike > &strike, const QuantLib::ext::shared_ptr< YoYInflationTermStructure > &curve, const QuantLib::Date &optionMaturityDate)
Return a yoy cap/floor strike value, the input strike can be of type absolute or atm forward.
InfJyBuilder::Helpers Helpers
Size size(const ValueType &v)
Date optionMaturity(const boost::variant< Date, Period > &maturity, const QuantLib::Calendar &calendar, const QuantLib::Date &referenceDate)
Real cpiCapFloorStrikeValue(const QuantLib::ext::shared_ptr< BaseStrike > &strike, const QuantLib::ext::shared_ptr< ZeroInflationTermStructure > &curve, const QuantLib::Date &optionMaturityDate)
Return a cpi cap/floor strike value, the input strike can be of type absolute or atm forward.
Serializable Credit Default Swap.
QuantLib::BootstrapHelper< QuantLib::OptionletVolatilityStructure > helper
class for holding details of a year on year inflation swap calibration instrument.