19#include <ql/cashflows/simplecashflow.hpp>
20#include <ql/pricingengines/blackformula.hpp>
25using QuantLib::DiscountFactor;
27using QuantLib::SimpleCashFlow;
36 : model_(model), index_(index) {}
42 if (cf.hasOccurred()) {
49 DiscountFactor df =
model_->irlgm1f(irIdx)->termStructure()->discount(
arguments_.payDate);
51 QL_DEPRECATED_DISABLE_WARNING
52 bool interpolate =
arguments_.observationInterpolation == CPI::Linear ||
54 QL_DEPRECATED_ENABLE_WARNING
56 auto zts =
model_->infjy(
index_)->realRate()->termStructure();
57 Real t = inflationYearFraction(
arguments_.index->frequency(), interpolate, zts->dayCounter(), zts->baseDate(),
81 Real v =
integral(*
model_,
P(
LC(H_n_t, -1.0,
Hz(irIdx)),
LC(H_n_t, -1.0,
Hz(irIdx)),
az(irIdx),
az(irIdx)), 0.0, t);
82 v +=
integral(*
model_,
P(
LC(H_r_t, -1.0,
Hy(
index_)),
LC(H_r_t, -1.0,
Hy(
index_)),
ay(
index_),
ay(
index_)), 0.0, t);
86 P(
rzy(irIdx,
index_),
LC(H_r_t, -1.0,
Hy(
index_)),
LC(H_n_t, -1.0,
Hz(irIdx)),
ay(
index_),
az(irIdx)),
88 v += 2 *
integral(*
model_,
P(
rzy(irIdx,
index_, 1),
LC(H_n_t, -1.0,
Hz(irIdx)),
az(irIdx),
sy(
index_)), 0.0, t);
90 integral(*
model_,
P(
ryy(
index_,
index_, 0, 1),
LC(H_r_t, -1.0,
Hy(
index_)),
ay(
index_),
sy(
index_)), 0.0, t);
Analytic Jarrow Yildrim (JY) CPI cap floor engine.
const Instrument::results * results_
void calculate() const override
const QuantLib::ext::shared_ptr< CrossAssetModel > model_
AnalyticJyCpiCapFloorEngine(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, QuantLib::Size index)
analytics for the cross asset model
const LC1_< E1 > LC(QuantLib::Real c, QuantLib::Real c1, const E1 &e1)
Real integral(const CrossAssetModel &model, const E &e, const Real a, const Real b)
const P2_< E1, E2 > P(const E1 &e1, const E2 &e2)
RandomVariable sqrt(RandomVariable x)
CompiledFormula pow(CompiledFormula x, const CompiledFormula &y)
CompiledFormula max(CompiledFormula x, const CompiledFormula &y)
INF H component. May relate to real rate portion of JY model or z component of DK model.
QuantLib::Real eval(const CrossAssetModel &x, const QuantLib::Real t) const
Real eval(const CrossAssetModel &x, const Real t) const
INF alpha component. May relate to real rate portion of JY model or z component of DK model.
JY INF index sigma component.
Swap::arguments * arguments_