QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
extendedornsteinuhlenbeckprocess.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) 2010 Klaus Spanderen
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20/*! \file extendedornsteinuhlenbeckprocess.hpp
21 \brief extended Ornstein-Uhlenbeck process
22*/
23
24#ifndef quantlib_extended_ornstein_uhlenbeck_process_hpp
25#define quantlib_extended_ornstein_uhlenbeck_process_hpp
26
28#include <ql/functional.hpp>
29
30namespace QuantLib {
31
32 class OrnsteinUhlenbeckProcess;
33
34 //! Extended Ornstein-Uhlenbeck process class
35 /*! This class describes the Ornstein-Uhlenbeck process governed by
36 \f[
37 dx = a (b(t) - x_t) dt + \sigma dW_t.
38 \f]
39
40 \ingroup processes
41 */
43 public:
45
48 Real x0,
49 ext::function<Real(Real)> b,
50 Discretization discretization = MidPoint,
51 Real intEps = 1e-4);
52
53 //! \name StochasticProcess interface
54 //@{
55 Real x0() const override;
56 Real speed() const;
57 Real volatility() const;
58 Real drift(Time t, Real x) const override;
59 Real diffusion(Time t, Real x) const override;
60 Real expectation(Time t0, Real x0, Time dt) const override;
61 Real stdDeviation(Time t0, Real x0, Time dt) const override;
62 Real variance(Time t0, Real x0, Time dt) const override;
63 //@}
64 private:
65 const Real speed_;
67 const ext::function<Real (Real)> b_;
69 const ext::shared_ptr<OrnsteinUhlenbeckProcess> ouProcess_;
71 };
72}
73
74
75#endif
Extended Ornstein-Uhlenbeck process class.
Real diffusion(Time t, Real x) const override
returns the diffusion part of the equation, i.e.
Real stdDeviation(Time t0, Real x0, Time dt) const override
const ext::shared_ptr< OrnsteinUhlenbeckProcess > ouProcess_
Real drift(Time t, Real x) const override
returns the drift part of the equation, i.e.
Real expectation(Time t0, Real x0, Time dt) const override
Real x0() const override
returns the initial value of the state variable
1-dimensional stochastic process
const DefaultType & t
ext::function< Real(Real)> b
LinearInterpolation variance
Maps function, bind and cref to either the boost or std implementation.
Real Time
continuous quantity with 1-year units
Definition: types.hpp:62
QL_REAL Real
real number
Definition: types.hpp:50
Real Volatility
volatility
Definition: types.hpp:78
Real sigma
Definition: any.hpp:35
stochastic processes