QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
stochasticprocessarray.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) 2005 Klaus Spanderen
5 Copyright (C) 2005 StatPro Italia srl
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/*! \file stochasticprocessarray.hpp
22 \brief Array of correlated 1-D stochastic processes
23*/
24
25#ifndef quantlib_stochastic_process_array_hpp
26#define quantlib_stochastic_process_array_hpp
27
29#include <vector>
30
31namespace QuantLib {
32
33 //! %Array of correlated 1-D stochastic processes
34 /*! \ingroup processes */
36 public:
38 const std::vector<ext::shared_ptr<StochasticProcess1D> >&,
39 const Matrix& correlation);
40 // stochastic process interface
41 Size size() const override;
42 Array initialValues() const override;
43 Array drift(Time t, const Array& x) const override;
44 Array expectation(Time t0, const Array& x0, Time dt) const override;
45
46 Matrix diffusion(Time t, const Array& x) const override;
47 Matrix covariance(Time t0, const Array& x0, Time dt) const override;
48 Matrix stdDeviation(Time t0, const Array& x0, Time dt) const override;
49
50 Array apply(const Array& x0, const Array& dx) const override;
51 Array evolve(Time t0, const Array& x0, Time dt, const Array& dw) const override;
52
53 Time time(const Date&) const override;
54 // inspectors
55 const ext::shared_ptr<StochasticProcess1D>& process(Size i) const;
56 Matrix correlation() const;
57 protected:
58 std::vector<ext::shared_ptr<StochasticProcess1D> > processes_;
60 };
61
62}
63
64
65#endif
1-D array used in linear algebra.
Definition: array.hpp:52
Concrete date class.
Definition: date.hpp:125
Matrix used in linear algebra.
Definition: matrix.hpp:41
Array of correlated 1-D stochastic processes
Array drift(Time t, const Array &x) const override
returns the drift part of the equation, i.e.,
Size size() const override
returns the number of dimensions of the stochastic process
Array evolve(Time t0, const Array &x0, Time dt, const Array &dw) const override
const ext::shared_ptr< StochasticProcess1D > & process(Size i) const
Matrix diffusion(Time t, const Array &x) const override
returns the diffusion part of the equation, i.e.
Time time(const Date &) const override
Matrix stdDeviation(Time t0, const Array &x0, Time dt) const override
Matrix covariance(Time t0, const Array &x0, Time dt) const override
Array expectation(Time t0, const Array &x0, Time dt) const override
Array initialValues() const override
returns the initial values of the state variables
Array apply(const Array &x0, const Array &dx) const override
std::vector< ext::shared_ptr< StochasticProcess1D > > processes_
multi-dimensional stochastic process class.
const DefaultType & t
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35
stochastic processes