QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
swaptionpseudojacobian.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
5 Copyright (C) 2008 Mark Joshi
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21
22#ifndef quantlib_swaption_pseudo_jacobian_hpp
23#define quantlib_swaption_pseudo_jacobian_hpp
24
25
27
28/*! In order to compute market vegas, we need a class that gives the
29derivative of a swaption implied vol against changes in pseudo-root elements.
30This is that class.
31
32This is tested in the pathwise vegas routine in MarketModels.cpp
33
34*/
35
36namespace QuantLib
37{
39 {
40
41 public:
42 SwaptionPseudoDerivative(const ext::shared_ptr<MarketModel>& inputModel,
43 Size startIndex,
44 Size endIndex);
45
46 const Matrix& varianceDerivative(Size i) const;
47 const Matrix& volatilityDerivative(Size i) const;
48
49 Real impliedVolatility() const;
50 Real variance() const;
51 Real expiry() const;
52
53
54
55 private:
56 ext::shared_ptr<MarketModel> inputModel_;
57 std::vector<Matrix> varianceDerivatives_;
58 std::vector<Matrix> volatilityDerivatives_;
59
63
64
65 };
66
67/*! In order to compute market vegas, we need a class that gives the
68derivative of a cap implied vol against changes in pseudo-root elements.
69This is that class.
70
71The operation is non-trivial because the cap implied vol has a complicated
72relationship with the caplet implied vols.
73
74This is tested in the pathwise vegas routine in MarketModels.cpp
75
76*/
77
79 {
80
81 public:
82 CapPseudoDerivative(const ext::shared_ptr<MarketModel>& inputModel,
83 Real strike,
84 Size startIndex,
85 Size endIndex,
86 Real firstDF);
87
88 const Matrix& volatilityDerivative(Size i) const;
89 const Matrix& priceDerivative(Size i) const;
90
91 Real impliedVolatility() const;
92
93
94
95 private:
96 ext::shared_ptr<MarketModel> inputModel_;
97
98 std::vector<Matrix> volatilityDerivatives_;
99
100 std::vector<Matrix> priceDerivatives_;
101
105
106
107
108 };
109
110}
111
112#endif
ext::shared_ptr< MarketModel > inputModel_
const Matrix & priceDerivative(Size i) const
const Matrix & volatilityDerivative(Size i) const
std::vector< Matrix > volatilityDerivatives_
Matrix used in linear algebra.
Definition: matrix.hpp:41
ext::shared_ptr< MarketModel > inputModel_
const Matrix & varianceDerivative(Size i) const
const Matrix & volatilityDerivative(Size i) const
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35