QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
expcorrelations.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 Marco Bianchetti
6 Copyright (C) 2007 Giorgio Facchinetti
7 Copyright (C) 2007 François du Vignaud
8
9 This file is part of QuantLib, a free-software/open-source library
10 for financial quantitative analysts and developers - http://quantlib.org/
11
12 QuantLib is free software: you can redistribute it and/or modify it
13 under the terms of the QuantLib license. You should have received a
14 copy of the license along with this program; if not, please email
15 <quantlib-dev@lists.sf.net>. The license is also available online at
16 <http://quantlib.org/license.shtml>.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the license for more details.
21*/
22
23/*! \file expcorrelations.hpp
24 \brief exponential correlation matrix
25*/
26
27#ifndef quantlib_exp_correlations_hpp
28#define quantlib_exp_correlations_hpp
29
30#include <ql/math/matrix.hpp>
32
33namespace QuantLib {
34
35 /*! Exponential correlation
36 L = long term correlation
37 beta = exponential decay of correlation between far away forward rates
38 gamma = exponent for time to go
39 t = time dependence
40 */
41 Matrix exponentialCorrelations(const std::vector<Time>& rateTimes,
42 Real longTermCorr = 0.5,
43 Real beta = 0.2,
44 Real gamma = 1.0,
45 Time t = 0.0);
46
49 public:
50 ExponentialForwardCorrelation(const std::vector<Time>& rateTimes,
51 Real longTermCorr = 0.5,
52 Real beta = 0.2,
53 Real gamma = 1.0,
54 std::vector<Time> times = std::vector<Time>());
55 const std::vector<Time>& times() const override;
56 const std::vector<Time>& rateTimes() const override;
57 const std::vector<Matrix>& correlations() const override;
58 Size numberOfRates() const override;
59
60 private:
63 std::vector<Time> rateTimes_, times_;
64 std::vector<Matrix> correlations_;
65 };
66}
67
68#endif
const std::vector< Time > & rateTimes() const override
const std::vector< Time > & times() const override
const std::vector< Matrix > & correlations() const override
const DefaultType & t
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
matrix used in linear algebra.
Definition: any.hpp:35
Matrix exponentialCorrelations(const std::vector< Time > &rateTimes, Real longTermCorr, Real beta, Real gamma, Time time)
Real beta
Definition: sabr.cpp:200