30 const QuantLib::ext::shared_ptr<CrossAssetModel>& model, Size index)
31 : ZeroInflationModelTermStructure(model, index) {}
33QL_DEPRECATED_DISABLE_WARNING
34JyImpliedZeroInflationTermStructure::JyImpliedZeroInflationTermStructure(
35 const QuantLib::ext::shared_ptr<CrossAssetModel>& model, Size index,
bool indexIsInterpolated)
36 : ZeroInflationModelTermStructure(model, index, indexIsInterpolated) {}
37QL_DEPRECATED_ENABLE_WARNING
39Real JyImpliedZeroInflationTermStructure::zeroRateImpl(Time t)
const {
41 QL_REQUIRE(t >= 0.0,
"JyImpliedZeroInflationTermStructure::zeroRateImpl: negative time (" << t <<
") given");
46 auto S = relativeTime_;
47 auto T = relativeTime_ + t;
48 QL_DEPRECATED_DISABLE_WARNING
49 auto ratio =
inflationGrowth(model_, index_, S, T, state_[2], state_[0], indexIsInterpolated_);
50 QL_DEPRECATED_ENABLE_WARNING
52 return std::pow(ratio, 1 / t) - 1;
55void JyImpliedZeroInflationTermStructure::checkState()
const {
57 QL_REQUIRE(state_.size() == 3,
"JyImpliedZeroInflationTermStructure: expected state to have " <<
58 "three elements but got " << state_.size());
61Real
inflationGrowth(
const QuantLib::ext::shared_ptr<CrossAssetModel>& model, Size index,
62 Time S, Time T, Real irState, Real rrState,
bool indexIsInterpolated) {
64 QL_REQUIRE(T >= S,
"inflationGrowth: end time (" << T <<
") must be >= start time (" << S <<
")");
69 auto irIdx = model->ccyIndex(model->infjy(index)->currency());
70 auto irTs = model->irlgm1f(irIdx)->termStructure();
71 auto p_n = model->discountBond(irIdx, S, T, irState) * irTs->discount(S) / irTs->discount(T);
76 auto rrParam = model->infjy(index)->realRate();
77 auto H_r_S = rrParam->H(S);
78 auto H_r_T = rrParam->H(T);
79 auto zeta_r_S = rrParam->zeta(S);
80 auto p_r = std::exp(-(H_r_T - H_r_S) * rrState - 0.5 * (H_r_T * H_r_T - H_r_S * H_r_S) * zeta_r_S);
84 const auto& zts = model->infjy(index)->realRate()->termStructure();
JyImpliedZeroInflationTermStructure(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, QuantLib::Size index)
analytics for the cross asset model
some inflation related utilities.
zero inflation term structure implied by a Jarrow Yildrim (JY) model
Real inflationGrowth(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, Size index, Time S, Time T, Real irState, Real rrState, bool indexIsInterpolated)