QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
ratepseudorootjacobian.hpp
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_rate_pseudo_root_hpp
23#define quantlib_rate_pseudo_root_hpp
24
25// to be removed using forward declaration
26
27
28#include <ql/models/marketmodels/driftcomputation/lmmdriftcalculator.hpp>
29
40namespace QuantLib
41{
42
44 {
45 public:
47 Size aliveIndex,
48 Size numeraire,
49 const std::vector<Time>& taus,
50 const std::vector<Matrix>& pseudoBumps,
51 const std::vector<Spread>& displacements);
52
53 void getBumps(const std::vector<Rate>& oldRates,
54 const std::vector<Real>& oneStepDFs, // redundant info but saves time to pass in since will have been needed elsewhere
55 const std::vector<Rate>& newRates, // redundant info but saves time to pass in since will have been needed elsewhere
56 const std::vector<Real>& gaussians,
57 Matrix& B); // B as in page 95 of the GG paper, rows should be number rates long, one row for bump
58
59 private:
60
64 std::vector<Time> taus_;
65 std::vector<Matrix> pseudoBumped_;
66 std::vector<Spread> displacements_;
68 std::vector<LMMDriftCalculator> driftsComputers_;
70
72 std::vector<Real> drifts_;
73 std::vector<Real> bumpedRates_;
74
75 };
76
77
78
79
81 {
82 public:
83 RatePseudoRootJacobian(const Matrix& pseudoRoot,
84 Size aliveIndex,
85 Size numeraire,
86 const std::vector<Time>& taus,
87 const std::vector<Matrix>& pseudoBumps,
88 std::vector<Spread> displacements);
89
90 void getBumps(const std::vector<Rate>& oldRates,
91 const std::vector<Real>& oneStepDFs, // redundant info but saves time to pass in
92 // since will have been needed elsewhere
93 const std::vector<Rate>& newRates, // redundant info but saves time to pass in
94 // since will have been needed elsewhere
95 const std::vector<Real>& gaussians,
96 Matrix& B); // B as in page 95 of the GG paper, rows should be number rates
97 // long, one row for each bump
98
99 private:
100
104 std::vector<Time> taus_;
105 std::vector<Matrix> pseudoBumps_;
106 std::vector<Spread> displacements_;
109
111
112 std::vector<Matrix> allDerivatives_;
113 // std::vector<Real> bumpedRates_;
115 std::vector<Real> ratios_;
116
117 };
118
119
121 {
122 public:
124 Size aliveIndex,
125 Size numeraire,
126 const std::vector<Time>& taus,
127 std::vector<Spread> displacements);
128
129 void getBumps(const std::vector<Rate>& oldRates,
130 const std::vector<Real>& oneStepDFs, // redundant info but saves time to pass in
131 // since will have been needed elsewhere
132 const std::vector<Rate>& newRates, // redundant info but saves time to pass in
133 // since will have been needed elsewhere
134 const std::vector<Real>& gaussians,
135 std::vector<Matrix>&
136 B); // one Matrix for each rate, the elements of the matrix are the
137 // derivatives of that rate with respect to each pseudo-root element
138
139 private:
140
144 std::vector<Time> taus_;
145 std::vector<Matrix> pseudoBumps_;
146 std::vector<Spread> displacements_;
148
150
152 std::vector<Real> ratios_;
153
154 };
155
156}
157
158#endif
Matrix used in linear algebra.
Definition: matrix.hpp:41
Matrix pseudoRoot_
this data does not change after construction
void getBumps(const std::vector< Rate > &oldRates, const std::vector< Real > &oneStepDFs, const std::vector< Rate > &newRates, const std::vector< Real > &gaussians, std::vector< Matrix > &B)
Matrix pseudoRoot_
this data does not change after construction
std::vector< Matrix > allDerivatives_
workspace variables
void getBumps(const std::vector< Rate > &oldRates, const std::vector< Real > &oneStepDFs, const std::vector< Rate > &newRates, const std::vector< Real > &gaussians, Matrix &B)
Matrix pseudoRoot_
this data is always the same
void getBumps(const std::vector< Rate > &oldRates, const std::vector< Real > &oneStepDFs, const std::vector< Rate > &newRates, const std::vector< Real > &gaussians, Matrix &B)
std::vector< Real > drifts_
workspace variables
std::vector< LMMDriftCalculator > driftsComputers_
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35