Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
nonstandardinflationcouponpricer.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2021 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/cashflows/nonstandardinflationcouponpricer.hpp
20 \brief pricer for the generalized (nonstandard) yoy coupon
21 the payoff of the coupon is:
22 N * (alpha * I_t/I_s + beta)
23 N * (alpha * (I_t/I_s - 1) + beta)
24 with arbitrary s < t. In the regular coupon the period between
25 s and t is hardcoded to one year. This pricer ignores any convexity adjustments
26 in the YoY coupon.
27 \ingroup cashflows
28*/
29
30#ifndef quantext_nonstandard_yoy_inflation_coupon_pricer_hpp
31#define quantext_nonstandard_yoy_inflation_coupon_pricer_hpp
32
33#include <ql/cashflow.hpp>
34#include <ql/cashflows/inflationcouponpricer.hpp>
35#include <ql/option.hpp>
36#include <ql/termstructures/volatility/inflation/yoyinflationoptionletvolatilitystructure.hpp>
38
39namespace QuantExt {
40
41using namespace QuantLib;
42//! base pricer for capped/floored YoY inflation coupons
43/*! \note this pricer can already do swaplets but to get
44 volatility-dependent coupons you need the descendents.
45*/
46class NonStandardYoYInflationCouponPricer : public QuantLib::InflationCouponPricer {
47public:
48 NonStandardYoYInflationCouponPricer(const Handle<YieldTermStructure>& nominalTermStructure);
49 NonStandardYoYInflationCouponPricer(const Handle<YoYOptionletVolatilitySurface>& capletVol,
50 const Handle<YieldTermStructure>& nominalTermStructure);
51
52 virtual Handle<YoYOptionletVolatilitySurface> capletVolatility() const { return capletVol_; }
53
54 virtual Handle<YieldTermStructure> nominalTermStructure() const { return nominalTermStructure_; }
55
56 virtual void setCapletVolatility(const Handle<YoYOptionletVolatilitySurface>& capletVol);
57
58 //! \name InflationCouponPricer interface
59 //@{
60 virtual Real swapletPrice() const override;
61 virtual Rate swapletRate() const override;
62 virtual Real capletPrice(Rate effectiveCap) const override;
63 virtual Rate capletRate(Rate effectiveCap) const override;
64 virtual Real floorletPrice(Rate effectiveFloor) const override;
65 virtual Rate floorletRate(Rate effectiveFloor) const override;
66 virtual void initialize(const InflationCoupon&) override;
67 //@}
68
69protected:
70 virtual Real optionletPrice(Option::Type optionType, Real effStrike) const;
71 virtual Real optionletRate(Option::Type optionType, Real effStrike) const;
72
73 /*! Derived classes usually only need to implement this.
74
75 The name of the method is misleading. This actually
76 returns the rate of the optionlet (so not discounted and
77 not accrued).
78 */
79 virtual Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const;
80 virtual Rate adjustedFixing(Rate fixing = Null<Rate>()) const;
81
82 //! data
83 Handle<YoYOptionletVolatilitySurface> capletVol_;
84 Handle<YieldTermStructure> nominalTermStructure_;
87 Spread spread_;
89};
90
91//! Black-formula pricer for capped/floored yoy inflation coupons
93public:
96 NonStandardBlackYoYInflationCouponPricer(const Handle<YoYOptionletVolatilitySurface>& capletVol,
97 const Handle<YieldTermStructure>& nominalTermStructure)
99
100protected:
101 Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const override;
102};
103
104//! Unit-Displaced-Black-formula pricer for capped/floored yoy inflation coupons
106public:
109 NonStandardUnitDisplacedBlackYoYInflationCouponPricer(const Handle<YoYOptionletVolatilitySurface>& capletVol,
110 const Handle<YieldTermStructure>& nominalTermStructure)
112
113protected:
114 Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const override;
115};
116
117//! Bachelier-formula pricer for capped/floored yoy inflation coupons
119public:
122
123 NonStandardBachelierYoYInflationCouponPricer(const Handle<YoYOptionletVolatilitySurface>& capletVol,
124 const Handle<YieldTermStructure>& nominalTermStructure)
126
127protected:
128 Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const override;
129};
130
131} // namespace QuantExt
132
133#endif
Bachelier-formula pricer for capped/floored yoy inflation coupons.
Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const override
NonStandardBachelierYoYInflationCouponPricer(const Handle< YoYOptionletVolatilitySurface > &capletVol, const Handle< YieldTermStructure > &nominalTermStructure)
NonStandardBachelierYoYInflationCouponPricer(const Handle< YieldTermStructure > &nominalTermStructure)
Black-formula pricer for capped/floored yoy inflation coupons.
Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const override
NonStandardBlackYoYInflationCouponPricer(const Handle< YoYOptionletVolatilitySurface > &capletVol, const Handle< YieldTermStructure > &nominalTermStructure)
NonStandardBlackYoYInflationCouponPricer(const Handle< YieldTermStructure > &nominalTermStructure)
Unit-Displaced-Black-formula pricer for capped/floored yoy inflation coupons.
NonStandardUnitDisplacedBlackYoYInflationCouponPricer(const Handle< YieldTermStructure > &nominalTermStructure)
Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const override
NonStandardUnitDisplacedBlackYoYInflationCouponPricer(const Handle< YoYOptionletVolatilitySurface > &capletVol, const Handle< YieldTermStructure > &nominalTermStructure)
Coupon paying a YoY-inflation type index
base pricer for capped/floored YoY inflation coupons
virtual void initialize(const InflationCoupon &) override
virtual Real capletPrice(Rate effectiveCap) const override
virtual Rate floorletRate(Rate effectiveFloor) const override
virtual Rate adjustedFixing(Rate fixing=Null< Rate >()) const
virtual Real optionletPrice(Option::Type optionType, Real effStrike) const
virtual Handle< YieldTermStructure > nominalTermStructure() const
virtual Handle< YoYOptionletVolatilitySurface > capletVolatility() const
virtual Real optionletRate(Option::Type optionType, Real effStrike) const
virtual Real optionletPriceImp(Option::Type, Real strike, Real forward, Real stdDev) const
virtual Real floorletPrice(Rate effectiveFloor) const override
virtual void setCapletVolatility(const Handle< YoYOptionletVolatilitySurface > &capletVol)
Handle< YoYOptionletVolatilitySurface > capletVol_
data
virtual Rate capletRate(Rate effectiveCap) const override
capped floored coupon which generalize the yoy inflation coupon it pays: N * (alpha * I_t/I_s + beta)...