Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
cpivolatilitystructure.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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/termstructures/inflation/cpivolatilitystructure.hpp
20 \brief interpolated correlation term structure
21*/
22
23#pragma once
24
25#include <ql/termstructures/volatility/inflation/cpivolatilitystructure.hpp>
26#include <ql/termstructures/volatility/volatilitytype.hpp>
27
28namespace QuantExt {
29
30/*! Abstract interface. CPI volatility is always with respect to
31 some base date of the quoted Zero Coupon Caps and Floor.
32 Also deal with lagged observations of an index
33 with a (usually different) availability lag.
34*/
35class CPIVolatilitySurface : public QuantLib::CPIVolatilitySurface {
36public:
37 /*! the capfloor startdate is the start date of the quoted market instruments,
38 * usually its today, but it could be in the future (e.g. AUCPI)
39 */
40 CPIVolatilitySurface(QuantLib::Natural settlementDays, const QuantLib::Calendar&,
41 QuantLib::BusinessDayConvention bdc, const QuantLib::DayCounter& dc,
42 const QuantLib::Period& observationLag, QuantLib::Frequency frequency,
43 bool indexIsInterpolated, const QuantLib::Date& capFloorStartDate = QuantLib::Date(),
44 QuantLib::VolatilityType volType = QuantLib::ShiftedLognormal, double displacement = 0.0);
45
46 //! Computes the expiry date from the capFloorStartDate()
47 QuantLib::Date optionDateFromTenor(const QuantLib::Period& tenor) const override;
48
49 //! base date will be in the past
50 QuantLib::Date baseDate() const override;
51
52 //! Returns the volatility type
53 QuantLib::VolatilityType volatilityType() const { return volType_; }
54 //! Returns the displacement for lognormal volatilities
55 double displacement() const { return displacement_; }
56
57 bool isLogNormal() const { return volatilityType() == QuantLib::ShiftedLognormal; }
58
59 using QuantLib::CPIVolatilitySurface::volatility;
60 QuantLib::Volatility volatility(const QuantLib::Date& maturityDate, QuantLib::Rate strike,
61 const QuantLib::Period& obsLag = QuantLib::Period(-1, QuantLib::Days),
62 bool extrapolate = false) const override;
63
64 virtual QuantLib::Real atmStrike(const QuantLib::Date& maturity,
65 const QuantLib::Period& obsLag = QuantLib::Period(-1, QuantLib::Days)) const = 0;
66
67 QuantLib::Date capFloorStartDate() const;
68
69protected:
70 //! Computes the expiry time from the capFloorStartDate()
71 // time from reference till relevant fixing Date for a capFloor expiriy at maturityDate
72
73
74 virtual double fixingTime(const QuantLib::Date& maturityDate) const;
75
76
77 QuantLib::VolatilityType volType_;
79
80private:
81 QuantLib::Date capFloorStartDate_;
82};
83
84} // namespace QuantExt
QuantLib::VolatilityType volatilityType() const
Returns the volatility type.
double displacement() const
Returns the displacement for lognormal volatilities.
QuantLib::Date baseDate() const override
base date will be in the past
virtual QuantLib::Real atmStrike(const QuantLib::Date &maturity, const QuantLib::Period &obsLag=QuantLib::Period(-1, QuantLib::Days)) const =0
QuantLib::Date capFloorStartDate() const
virtual double fixingTime(const QuantLib::Date &maturityDate) const
Computes the expiry time from the capFloorStartDate()
QuantLib::Volatility volatility(const QuantLib::Date &maturityDate, QuantLib::Rate strike, const QuantLib::Period &obsLag=QuantLib::Period(-1, QuantLib::Days), bool extrapolate=false) const override
QuantLib::Date optionDateFromTenor(const QuantLib::Period &tenor) const override
Computes the expiry date from the capFloorStartDate()