Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
strippedyoyinflationoptionletvol.hpp
Go to the documentation of this file.
1/*
2Copyright (C) 2019 Quaternion Risk Management Ltd
3All rights reserved.
4
5This file is part of ORE, a free-software/open-source library
6for transparent pricing and risk analysis - http://opensourcerisk.org
7
8ORE is free software: you can redistribute it and/or modify it
9under the terms of the Modified BSD License. You should have received a
10copy of the license along with this program.
11The license is also available online at <http://opensourcerisk.org>
12
13This program is distributed on the basis that it will form a useful
14contribution to risk analytics and model standardisation, but WITHOUT
15ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/termstructures/strippedyoyinflationoptionletvol.hpp
20\brief Stripped YoYInfaltion Optionlet Vol Adapter (with a deeper update method, linear interpolation and optional flat
21extrapolation) \ingroup termstructures
22*/
23
24#ifndef quantext_stripped_yoy_inflation_optionlet_vol
25#define quantext_stripped_yoy_inflation_optionlet_vol
26
27#include <ql/math/interpolation.hpp>
28#include <ql/math/interpolations/sabrinterpolation.hpp>
29#include <ql/termstructures/volatility/inflation/yoyinflationoptionletvolatilitystructure.hpp>
30#include <ql/termstructures/volatility/optionlet/optionletstripper.hpp>
31#include <ql/termstructures/volatility/optionlet/strippedoptionletbase.hpp>
32
33namespace QuantExt {
34
35/*! Helper class to wrap in a YoYOptionletVolatilitySurface object.
36\ingroup termstructures
37*/
38class StrippedYoYInflationOptionletVol : public QuantLib::YoYOptionletVolatilitySurface, public QuantLib::LazyObject {
39public:
40 StrippedYoYInflationOptionletVol(Natural settlementDays, const Calendar& calendar, BusinessDayConvention bdc,
41 const DayCounter& dc, const Period& observationLag, Frequency frequency,
42 bool indexIsInterpolated, const std::vector<Date>& yoyoptionletDates,
43 const std::vector<Rate>& strikes, const std::vector<std::vector<Handle<Quote> > >&,
44 VolatilityType type = ShiftedLognormal, Real displacement = 0.0);
45
46 QuantLib::Date maxDate() const override;
47 void performCalculations() const override;
48 void update() override;
49
50 const std::vector<Rate>& yoyoptionletStrikes(Size i) const;
51 const std::vector<Volatility>& yoyoptionletVolatilities(Size i) const;
52
53 const std::vector<Date>& yoyoptionletFixingDates() const;
54 const std::vector<Time>& yoyoptionletFixingTimes() const;
55
56 DayCounter dayCounter() const override;
57 Calendar calendar() const override;
58 Natural settlementDays() const override;
59 BusinessDayConvention businessDayConvention() const override;
60
61 QuantLib::VolatilityType volatilityType() const override;
62 QuantLib::Real displacement() const override;
63
64protected:
65 QuantLib::Rate minStrike() const override;
66 QuantLib::Rate maxStrike() const override;
67 QuantLib::Volatility volatilityImpl(Time length, QuantLib::Rate strike) const override;
68
69private:
70 void checkInputs() const;
72
73 Calendar calendar_;
75 BusinessDayConvention businessDayConvention_;
76 DayCounter dc_;
77 VolatilityType type_;
79
81 std::vector<Date> yoyoptionletDates_;
82 std::vector<Time> yoyoptionletTimes_;
83 std::vector<std::vector<Rate> > yoyoptionletStrikes_;
85
86 std::vector<std::vector<Handle<Quote> > > yoyoptionletVolQuotes_;
87 mutable std::vector<std::vector<Volatility> > yoyoptionletVolatilities_;
88};
89
91 TermStructure::update();
92 LazyObject::update();
93}
94
95} // namespace QuantExt
96
97#endif
QuantLib::Volatility volatilityImpl(Time length, QuantLib::Rate strike) const override
const std::vector< Volatility > & yoyoptionletVolatilities(Size i) const
QuantLib::VolatilityType volatilityType() const override
const std::vector< Rate > & yoyoptionletStrikes(Size i) const
BusinessDayConvention businessDayConvention() const override
std::vector< std::vector< Volatility > > yoyoptionletVolatilities_
std::vector< std::vector< Handle< Quote > > > yoyoptionletVolQuotes_
vector< Real > strikes