23#ifndef quantext_inflation_hpp
24#define quantext_inflation_hpp
26#include <ql/indexes/inflationindex.hpp>
27#include <ql/instruments/bond.hpp>
28#include <ql/termstructures/inflation/inflationhelpers.hpp>
29#include <ql/termstructures/inflationtermstructure.hpp>
30#include <ql/termstructures/volatility/inflation/cpivolatilitystructure.hpp>
31#include <ql/time/period.hpp>
41 const QuantLib::ext::shared_ptr<QuantLib::InflationTermStructure>& inflationTs,
42 bool indexIsInterpolated,
43 const QuantLib::DayCounter& dayCounter = QuantLib::DayCounter());
48QuantLib::Real
inflationGrowth(
const QuantLib::Handle<QuantLib::ZeroInflationTermStructure>& ts,
50 const QuantLib::DayCounter& dc,
51 bool indexIsInterpolated);
56QuantLib::Real
inflationGrowth(
const QuantLib::Handle<QuantLib::ZeroInflationTermStructure>& ts,
57 QuantLib::Time t,
bool indexIsInterpolated);
65std::map<std::tuple<std::string, QuantLib::CPI::InterpolationType, QuantLib::Frequency, QuantLib::Period>,
66 QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex>>
69namespace ZeroInflation {
72QuantLib::Date
lastAvailableFixing(
const QuantLib::ZeroInflationIndex& index,
const QuantLib::Date& asof);
76QuantLib::Rate
cpiFixing(
const QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex>& index,
const QuantLib::Date& maturity,
77 const QuantLib::Period& obsLag,
bool interpolated);
81QuantLib::Date
curveBaseDate(
const bool baseDateLastKnownFixing,
const QuantLib::Date& refDate,
82 const QuantLib::Period obsLagCurve,
const QuantLib::Frequency curveFreq,
83 const QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex>& index);
90QuantLib::Date
fixingDate(
const QuantLib::Date& d,
const QuantLib::Period obsLag,
91 const QuantLib::Frequency,
99QuantLib::Rate
guessCurveBaseRate(
const bool baseDateLastKnownFixing,
const QuantLib::Date& swapStart,
100 const QuantLib::Date& asof,
101 const QuantLib::Period& swapTenor,
const QuantLib::DayCounter& swapZCLegDayCounter,
102 const QuantLib::Period& swapObsLag,
const QuantLib::Rate zeroCouponRate,
103 const QuantLib::Period& curveObsLag,
const QuantLib::DayCounter& curveDayCounter,
104 const QuantLib::ext::shared_ptr<QuantLib::ZeroInflationIndex>& index,
const bool interpolated,
105 const QuantLib::ext::shared_ptr<QuantLib::Seasonality>& seasonality =
nullptr);
QuantLib::Date fixingDate(const QuantLib::Date &d, const QuantLib::Period obsLag, const QuantLib::Frequency freq, bool interpolated)
QuantLib::Date lastAvailableFixing(const QuantLib::ZeroInflationIndex &index, const QuantLib::Date &asof)
Check if today - availabilityLag is already known, otherwise return the fixingDate of the previous fi...
QuantLib::Rate cpiFixing(const QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > &index, const QuantLib::Date &maturity, const QuantLib::Period &obsLag, bool interpolated)
Computes a CPI fixing giving an zeroIndex, with interpolation if needed.
QuantLib::Date curveBaseDate(const bool baseDateLastKnownFixing, const QuantLib::Date &refDate, const QuantLib::Period obsLagCurve, const QuantLib::Frequency curveFreq, const QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > &index)
derives the zero inflation curve base date based on the useLastKnownFixing rule
QuantLib::Rate guessCurveBaseRate(const bool baseDateLastKnownFixing, const QuantLib::Date &swapStart, const QuantLib::Date &asof, const QuantLib::Period &swapTenor, const QuantLib::DayCounter &swapZCLegDayCounter, const QuantLib::Period &swapObsLag, const QuantLib::Rate zeroCouponRate, const QuantLib::Period &curveObsLag, const QuantLib::DayCounter &curveDayCounter, const QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > &index, const bool interpolated, const QuantLib::ext::shared_ptr< QuantLib::Seasonality > &seasonality)
bool isCPIVolSurfaceLogNormal(const QuantLib::ext::shared_ptr< QuantLib::CPIVolatilitySurface > &surface)
std::map< std::tuple< std::string, QuantLib::CPI::InterpolationType, QuantLib::Frequency, QuantLib::Period >, QuantLib::ext::shared_ptr< QuantLib::ZeroInflationIndex > > extractAllInflationUnderlyingFromBond(const QuantLib::ext::shared_ptr< QuantLib::Bond > &bond)
Real inflationLinkedBondQuoteFactor(const QuantLib::ext::shared_ptr< QuantLib::Bond > &bond)
Time inflationTime(const Date &date, const QuantLib::ext::shared_ptr< InflationTermStructure > &inflationTs, bool indexIsInterpolated, const DayCounter &dayCounter)
Real inflationGrowth(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, Size index, Time S, Time T, Real irState, Real rrState, bool indexIsInterpolated)