QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
ql
models
marketmodels
driftcomputation
cmsmmdriftcalculator.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 François du Vignaud
6
Copyright (C) 2007 Mark Joshi
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 cmsmmdriftcalculator.hpp
23
\brief Drift computation for CMS market model
24
*/
25
26
#ifndef quantlib_cms_drift_calculator_hpp
27
#define quantlib_cms_drift_calculator_hpp
28
29
#include <
ql/math/matrix.hpp
>
30
#include <vector>
31
32
namespace
QuantLib
{
33
34
class
CMSwapCurveState;
35
36
//! Drift computation for CMS market models
37
/*! Returns the drift \f$ \mu \Delta t \f$.
38
See Mark Joshi, <i>Rapid Computation of Drifts in a
39
Reduced Factor Libor Market Model</i>, Wilmott Magazine,
40
May 2003.
41
*/
42
class
CMSMMDriftCalculator
{
43
public
:
44
CMSMMDriftCalculator
(
const
Matrix
& pseudo,
45
const
std::vector<Spread>& displacements,
46
const
std::vector<Time>& taus,
47
Size
numeraire,
48
Size
alive,
49
Size
spanningFwds);
50
//! Computes the drifts
51
void
compute
(
const
CMSwapCurveState
& cs,
52
std::vector<Real>& drifts)
const
;
53
private
:
54
Size
numberOfRates_
,
numberOfFactors_
;
55
Size
numeraire_
,
alive_
;
56
std::vector<Spread>
displacements_
;
57
std::vector<Real>
oneOverTaus_
;
58
Matrix
C_
,
pseudo_
;
59
// temporary variables to be added later
60
mutable
std::vector<Real>
tmp_
;
61
mutable
Matrix
PjPnWk_
;
// < Wk, P_{j}/P_n> (k, j)
62
mutable
Matrix
wkaj_
;
// < Wk , Aj/Pn> (k, j)
63
mutable
Matrix
wkajN_
;
// < Wk , Aj/PN> (k, j)
64
65
std::vector<Size>
downs_
,
ups_
;
66
Size
spanningFwds_
;
67
};
68
69
}
70
71
#endif
QuantLib::CMSMMDriftCalculator
Drift computation for CMS market models.
Definition:
cmsmmdriftcalculator.hpp:42
QuantLib::CMSMMDriftCalculator::pseudo_
Matrix pseudo_
Definition:
cmsmmdriftcalculator.hpp:58
QuantLib::CMSMMDriftCalculator::numeraire_
Size numeraire_
Definition:
cmsmmdriftcalculator.hpp:55
QuantLib::CMSMMDriftCalculator::PjPnWk_
Matrix PjPnWk_
Definition:
cmsmmdriftcalculator.hpp:61
QuantLib::CMSMMDriftCalculator::displacements_
std::vector< Spread > displacements_
Definition:
cmsmmdriftcalculator.hpp:56
QuantLib::CMSMMDriftCalculator::tmp_
std::vector< Real > tmp_
Definition:
cmsmmdriftcalculator.hpp:60
QuantLib::CMSMMDriftCalculator::wkaj_
Matrix wkaj_
Definition:
cmsmmdriftcalculator.hpp:62
QuantLib::CMSMMDriftCalculator::alive_
Size alive_
Definition:
cmsmmdriftcalculator.hpp:55
QuantLib::CMSMMDriftCalculator::compute
void compute(const CMSwapCurveState &cs, std::vector< Real > &drifts) const
Computes the drifts.
Definition:
cmsmmdriftcalculator.cpp:74
QuantLib::CMSMMDriftCalculator::C_
Matrix C_
Definition:
cmsmmdriftcalculator.hpp:58
QuantLib::CMSMMDriftCalculator::spanningFwds_
Size spanningFwds_
Definition:
cmsmmdriftcalculator.hpp:66
QuantLib::CMSMMDriftCalculator::numberOfRates_
Size numberOfRates_
Definition:
cmsmmdriftcalculator.hpp:54
QuantLib::CMSMMDriftCalculator::numberOfFactors_
Size numberOfFactors_
Definition:
cmsmmdriftcalculator.hpp:54
QuantLib::CMSMMDriftCalculator::oneOverTaus_
std::vector< Real > oneOverTaus_
Definition:
cmsmmdriftcalculator.hpp:57
QuantLib::CMSMMDriftCalculator::downs_
std::vector< Size > downs_
Definition:
cmsmmdriftcalculator.hpp:65
QuantLib::CMSMMDriftCalculator::ups_
std::vector< Size > ups_
Definition:
cmsmmdriftcalculator.hpp:65
QuantLib::CMSMMDriftCalculator::wkajN_
Matrix wkajN_
Definition:
cmsmmdriftcalculator.hpp:63
QuantLib::CMSwapCurveState
Curve state for constant-maturity-swap market models
Definition:
cmswapcurvestate.hpp:30
QuantLib::Matrix
Matrix used in linear algebra.
Definition:
matrix.hpp:41
QuantLib::Size
std::size_t Size
size of a container
Definition:
types.hpp:58
matrix.hpp
matrix used in linear algebra.
QuantLib
Definition:
any.hpp:35
Generated by
Doxygen
1.9.5