Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
JyYoYInflationCouponPricer Class Reference

JY pricer for YoY inflation coupons. More...

#include <qle/cashflows/jyyoyinflationcouponpricer.hpp>

+ Inheritance diagram for JyYoYInflationCouponPricer:
+ Collaboration diagram for JyYoYInflationCouponPricer:

Public Member Functions

 JyYoYInflationCouponPricer (const QuantLib::ext::shared_ptr< CrossAssetModel > &model, QuantLib::Size index)
 

Private Member Functions

QuantLib::Real optionletRate (QuantLib::Option::Type optionType, QuantLib::Real effStrike) const override
 
QuantLib::Rate adjustedFixing (QuantLib::Rate fixing=QuantLib::Null< QuantLib::Rate >()) const override
 

Private Attributes

QuantLib::ext::shared_ptr< CrossAssetModelmodel_
 
QuantLib::Size index_
 

Detailed Description

JY pricer for YoY inflation coupons.

Definition at line 32 of file jyyoyinflationcouponpricer.hpp.

Constructor & Destructor Documentation

◆ JyYoYInflationCouponPricer()

JyYoYInflationCouponPricer ( const QuantLib::ext::shared_ptr< CrossAssetModel > &  model,
QuantLib::Size  index 
)

Constructor

Parameters
modelthe cross asset model to be used in the valuation.
indexthe index of the inflation component to use within the cross asset model.

Definition at line 30 of file jyyoyinflationcouponpricer.cpp.

31 : YoYInflationCouponPricer(model->irlgm1f(model->ccyIndex(model->infjy(index)->currency()))->termStructure()),
32 model_(model), index_(index) {
33
34 Size irIdx = model_->ccyIndex(model_->infjy(index_)->currency());
35 nominalTermStructure_ = model_->irlgm1f(irIdx)->termStructure();
36
37 registerWith(model_);
38 registerWith(nominalTermStructure_);
39}
QuantLib::ext::shared_ptr< CrossAssetModel > model_

Member Function Documentation

◆ optionletRate()

Real optionletRate ( QuantLib::Option::Type  optionType,
QuantLib::Real  effStrike 
) const
overrideprivate

Definition at line 41 of file jyyoyinflationcouponpricer.cpp.

41 {
42 QL_FAIL("JyYoYInflationCouponPricer::optionletRate: not implemented.");
43}

◆ adjustedFixing()

Rate adjustedFixing ( QuantLib::Rate  fixing = QuantLib::Null<QuantLib::Rate>()) const
overrideprivate

Definition at line 45 of file jyyoyinflationcouponpricer.cpp.

45 {
46
47 // We only need to use the Jarrow Yildrim model if both I(T) and I(S) are not yet known (i.e. published).
48 // If only I(S) is known, we have a ZCIIS. If both are known, we just use the published values. In either case,
49 // we can just ask the inflation index for its fixing.
50
51 // Fixing date associated with numerator inflation index value i.e. I(T). Incorporates the observation lag.
52 // It is essentially: coupon_end_date - contract_observation_lag.
53 Date numFixingDate = coupon_->fixingDate();
54
55 // Fixing date associated with denominator inflation index value i.e. I(S).
56 Date denFixingDate = numFixingDate - 1 * Years;
57
58 // If everything has been published in order to determine I(S), return model independent value read off curve.
59 // Logic to determine last available fixing and where forecasting is needed copied from YoYInflationIndex::fixing.
60 Date today = Settings::instance().evaluationDate();
61 const auto& index = coupon_->yoyIndex();
62 auto freq = index->frequency();
63 auto ip = inflationPeriod(today - index->availabilityLag(), freq);
64 bool isInterp = index->interpolated();
65 if ((!isInterp && denFixingDate < ip.first) || (isInterp && denFixingDate < ip.first - Period(freq))) {
66 return coupon_->indexFixing();
67 }
68
69 // Use the JY model to calculate the adjusted fixing.
70 auto zts = model_->infjy(index_)->realRate()->termStructure();
71 auto S = inflationTime(denFixingDate, *zts, index->interpolated());
72 auto T = inflationTime(numFixingDate, *zts, index->interpolated());
73
74 return jyExpectedIndexRatio(model_, index_, S, T, index->interpolated()) - 1;
75}
Real jyExpectedIndexRatio(const QuantLib::ext::shared_ptr< CrossAssetModel > &model, Size index, Time S, Time T, bool indexIsInterpolated)
Time inflationTime(const Date &date, const QuantLib::ext::shared_ptr< InflationTermStructure > &inflationTs, bool indexIsInterpolated, const DayCounter &dayCounter)
Definition: inflation.cpp:61
+ Here is the call graph for this function:

Member Data Documentation

◆ model_

QuantLib::ext::shared_ptr<CrossAssetModel> model_
private

Definition at line 42 of file jyyoyinflationcouponpricer.hpp.

◆ index_

QuantLib::Size index_
private

Definition at line 43 of file jyyoyinflationcouponpricer.hpp.