QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
optionletstripper.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2007 Ferdinando Ametrano
5 Copyright (C) 2007 Giorgio Facchinetti
6 Copyright (C) 2015 Peter Caspers
7
8 This file is part of QuantLib, a free-software/open-source library
9 for financial quantitative analysts and developers - http://quantlib.org/
10
11 QuantLib is free software: you can redistribute it and/or modify it
12 under the terms of the QuantLib license. You should have received a
13 copy of the license along with this program; if not, please email
14 <quantlib-dev@lists.sf.net>. The license is also available online at
15 <http://quantlib.org/license.shtml>.
16
17 This program is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19 FOR A PARTICULAR PURPOSE. See the license for more details.
20*/
21
22/*! \file optionletstripper.hpp
23 \brief optionlet (caplet/floorlet) volatility stripper
24*/
25
26#ifndef quantlib_optionletstripper_hpp
27#define quantlib_optionletstripper_hpp
28
33
34namespace QuantLib {
35
36 class IborIndex;
37
38 /*! StrippedOptionletBase specialization. It's up to derived
39 classes to implement LazyObject::performCalculations
40 */
42 public:
43 //! \name StrippedOptionletBase interface
44 //@{
45 const std::vector<Rate>& optionletStrikes(Size i) const override;
46 const std::vector<Volatility>& optionletVolatilities(Size i) const override;
47
48 const std::vector<Date>& optionletFixingDates() const override;
49 const std::vector<Time>& optionletFixingTimes() const override;
50 Size optionletMaturities() const override;
51
52 const std::vector<Rate>& atmOptionletRates() const override;
53
54 DayCounter dayCounter() const override;
55 Calendar calendar() const override;
56 Natural settlementDays() const override;
58 //@}
59
60 const std::vector<Period>& optionletFixingTenors() const;
61 const std::vector<Date>& optionletPaymentDates() const;
62 const std::vector<Time>& optionletAccrualPeriods() const;
63 ext::shared_ptr<CapFloorTermVolSurface> termVolSurface() const;
64 ext::shared_ptr<IborIndex> iborIndex() const;
65 Real displacement() const override;
66 VolatilityType volatilityType() const override;
67
68 protected:
69 OptionletStripper(const ext::shared_ptr<CapFloorTermVolSurface>&,
70 ext::shared_ptr<IborIndex> iborIndex_,
71 Handle<YieldTermStructure> discount = {},
73 Real displacement = 0.0);
74 ext::shared_ptr<CapFloorTermVolSurface> termVolSurface_;
75 ext::shared_ptr<IborIndex> iborIndex_;
79
80 mutable std::vector<std::vector<Rate> > optionletStrikes_;
81 mutable std::vector<std::vector<Volatility> > optionletVolatilities_;
82
83 mutable std::vector<Time> optionletTimes_;
84 mutable std::vector<Date> optionletDates_;
85 std::vector<Period> optionletTenors_;
86 mutable std::vector<Rate> atmOptionletRate_;
87 mutable std::vector<Date> optionletPaymentDates_;
88 mutable std::vector<Time> optionletAccrualPeriods_;
89
90 std::vector<Period> capFloorLengths_;
93 };
94
95}
96
97#endif
Cap/floor smile volatility surface.
calendar class
Definition: calendar.hpp:61
day counter class
Definition: daycounter.hpp:44
Shared handle to an observable.
Definition: handle.hpp:41
Calendar calendar() const override
std::vector< Rate > atmOptionletRate_
std::vector< std::vector< Volatility > > optionletVolatilities_
const std::vector< Date > & optionletFixingDates() const override
std::vector< Period > capFloorLengths_
ext::shared_ptr< CapFloorTermVolSurface > termVolSurface() const
Handle< YieldTermStructure > discount_
const std::vector< Rate > & optionletStrikes(Size i) const override
ext::shared_ptr< IborIndex > iborIndex_
std::vector< Date > optionletPaymentDates_
std::vector< Time > optionletAccrualPeriods_
const std::vector< Time > & optionletFixingTimes() const override
const std::vector< Date > & optionletPaymentDates() const
const std::vector< Volatility > & optionletVolatilities(Size i) const override
const std::vector< Rate > & atmOptionletRates() const override
std::vector< Period > optionletTenors_
VolatilityType volatilityType() const override
ext::shared_ptr< IborIndex > iborIndex() const
std::vector< Time > optionletTimes_
std::vector< Date > optionletDates_
Natural settlementDays() const override
DayCounter dayCounter() const override
const std::vector< Period > & optionletFixingTenors() const
const VolatilityType volatilityType_
BusinessDayConvention businessDayConvention() const override
std::vector< std::vector< Rate > > optionletStrikes_
Real displacement() const override
ext::shared_ptr< CapFloorTermVolSurface > termVolSurface_
const std::vector< Time > & optionletAccrualPeriods() const
Size optionletMaturities() const override
BusinessDayConvention
Business Day conventions.
QL_REAL Real
real number
Definition: types.hpp:50
unsigned QL_INTEGER Natural
positive integer
Definition: types.hpp:43
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
volatility types
Interest-rate term structure.