QuantLib
: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
ql
models
marketmodels
driftcomputation
smmdriftcalculator.hpp
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 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
25
#ifndef quantlib_smm_drift_calculator_hpp
26
#define quantlib_smm_drift_calculator_hpp
27
28
#include <ql/math/matrix.hpp>
29
#include <vector>
30
31
namespace
QuantLib
{
32
33
class
CoterminalSwapCurveState;
34
36
40
class
SMMDriftCalculator
{
41
public
:
42
SMMDriftCalculator
(
const
Matrix
& pseudo,
43
const
std::vector<Spread>& displacements,
44
const
std::vector<Time>& taus,
45
Size
numeraire,
46
Size
alive);
48
void
compute
(
const
CoterminalSwapCurveState
& cs,
49
std::vector<Real>& drifts)
const
;
50
private
:
51
Size
numberOfRates_
,
numberOfFactors_
;
52
Size
numeraire_
,
alive_
;
53
std::vector<Spread>
displacements_
;
54
std::vector<Real>
oneOverTaus_
;
55
Matrix
C_
,
pseudo_
;
56
// temporary variables to be added later
57
mutable
std::vector<Real>
tmp_
;
58
mutable
Matrix
wkaj_
;
// < W(k) | A(j)/P(n) >
59
mutable
Matrix
wkpj_
;
// < W(k) | P(j)/P(n) >
60
mutable
Matrix
wkajshifted_
;
61
};
62
63
}
64
65
#endif
QuantLib::CoterminalSwapCurveState
Curve state for coterminal-swap market models
Definition:
coterminalswapcurvestate.hpp:39
QuantLib::Matrix
Matrix used in linear algebra.
Definition:
matrix.hpp:41
QuantLib::SMMDriftCalculator
Drift computation for coterminal swap market models.
Definition:
smmdriftcalculator.hpp:40
QuantLib::SMMDriftCalculator::pseudo_
Matrix pseudo_
Definition:
smmdriftcalculator.hpp:55
QuantLib::SMMDriftCalculator::numeraire_
Size numeraire_
Definition:
smmdriftcalculator.hpp:52
QuantLib::SMMDriftCalculator::wkajshifted_
Matrix wkajshifted_
Definition:
smmdriftcalculator.hpp:60
QuantLib::SMMDriftCalculator::displacements_
std::vector< Spread > displacements_
Definition:
smmdriftcalculator.hpp:53
QuantLib::SMMDriftCalculator::tmp_
std::vector< Real > tmp_
Definition:
smmdriftcalculator.hpp:57
QuantLib::SMMDriftCalculator::wkaj_
Matrix wkaj_
Definition:
smmdriftcalculator.hpp:58
QuantLib::SMMDriftCalculator::wkpj_
Matrix wkpj_
Definition:
smmdriftcalculator.hpp:59
QuantLib::SMMDriftCalculator::alive_
Size alive_
Definition:
smmdriftcalculator.hpp:52
QuantLib::SMMDriftCalculator::C_
Matrix C_
Definition:
smmdriftcalculator.hpp:55
QuantLib::SMMDriftCalculator::numberOfRates_
Size numberOfRates_
Definition:
smmdriftcalculator.hpp:51
QuantLib::SMMDriftCalculator::numberOfFactors_
Size numberOfFactors_
Definition:
smmdriftcalculator.hpp:51
QuantLib::SMMDriftCalculator::oneOverTaus_
std::vector< Real > oneOverTaus_
Definition:
smmdriftcalculator.hpp:54
QuantLib::SMMDriftCalculator::compute
void compute(const CoterminalSwapCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
Definition:
smmdriftcalculator.cpp:71
QuantLib::Size
std::size_t Size
size of a container
Definition:
types.hpp:58
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5