QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
expcorrelations.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 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
27#ifndef quantlib_exp_correlations_hpp
28#define quantlib_exp_correlations_hpp
29
30#include <ql/math/matrix.hpp>
31#include <ql/models/marketmodels/piecewiseconstantcorrelation.hpp>
32
33namespace QuantLib {
34
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
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
Definition: any.hpp:35
Matrix exponentialCorrelations(const std::vector< Time > &rateTimes, Real longTermCorr, Real beta, Real gamma, Time time)