QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
1-dimensional stochastic process More...
#include <stochasticprocess.hpp>
Classes | |
class | discretization |
discretization of a 1-D stochastic process More... | |
1-D stochastic process interface | |
ext::shared_ptr< discretization > | discretization_ |
virtual Real | x0 () const =0 |
returns the initial value of the state variable More... | |
virtual Real | drift (Time t, Real x) const =0 |
returns the drift part of the equation, i.e. \( \mu(t, x_t) \) More... | |
virtual Real | diffusion (Time t, Real x) const =0 |
returns the diffusion part of the equation, i.e. \( \sigma(t, x_t) \) More... | |
virtual Real | expectation (Time t0, Real x0, Time dt) const |
virtual Real | stdDeviation (Time t0, Real x0, Time dt) const |
virtual Real | variance (Time t0, Real x0, Time dt) const |
virtual Real | evolve (Time t0, Real x0, Time dt, Real dw) const |
virtual Real | apply (Real x0, Real dx) const |
StochasticProcess1D ()=default | |
StochasticProcess1D (ext::shared_ptr< discretization >) | |
Size | size () const override |
returns the number of dimensions of the stochastic process More... | |
Array | initialValues () const override |
returns the initial values of the state variables More... | |
Array | drift (Time t, const Array &x) const override |
returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \) More... | |
Matrix | diffusion (Time t, const Array &x) const override |
returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \) More... | |
Array | expectation (Time t0, const Array &x0, Time dt) 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 | evolve (Time t0, const Array &x0, Time dt, const Array &dw) const override |
Array | apply (const Array &x0, const Array &dx) const override |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Public Member Functions inherited from StochasticProcess | |
~StochasticProcess () override=default | |
virtual Size | factors () const |
returns the number of independent factors of the process More... | |
virtual Time | time (const Date &) const |
void | update () override |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Protected Member Functions inherited from StochasticProcess | |
StochasticProcess ()=default | |
StochasticProcess (ext::shared_ptr< discretization >) | |
Protected Attributes inherited from StochasticProcess | |
ext::shared_ptr< discretization > | discretization_ |
1-dimensional stochastic process
This class describes a stochastic process governed by
\[ dx_t = \mu(t, x_t)dt + \sigma(t, x_t)dW_t. \]
Definition at line 163 of file stochasticprocess.hpp.
|
protecteddefault |
|
explicitprotected |
Definition at line 75 of file stochasticprocess.cpp.
|
pure virtual |
returns the initial value of the state variable
Implemented in ExtendedOrnsteinUhlenbeckProcess, GemanRoncoroniProcess, GeneralizedOrnsteinUhlenbeckProcess, VarianceGammaProcess, GeneralizedBlackScholesProcess, CoxIngersollRossProcess, GeometricBrownianMotionProcess, GsrProcess, HullWhiteProcess, HullWhiteForwardProcess, Merton76Process, MfStateProcess, OrnsteinUhlenbeckProcess, and SquareRootProcess.
returns the drift part of the equation, i.e. \( \mu(t, x_t) \)
Implemented in ExtendedBlackScholesMertonProcess, ExtendedOrnsteinUhlenbeckProcess, GemanRoncoroniProcess, GeneralizedOrnsteinUhlenbeckProcess, VarianceGammaProcess, GeneralizedBlackScholesProcess, CoxIngersollRossProcess, GeometricBrownianMotionProcess, GsrProcess, HullWhiteProcess, HullWhiteForwardProcess, MfStateProcess, OrnsteinUhlenbeckProcess, SquareRootProcess, and Merton76Process.
returns the diffusion part of the equation, i.e. \( \sigma(t, x_t) \)
Implemented in ExtendedBlackScholesMertonProcess, ExtendedOrnsteinUhlenbeckProcess, GemanRoncoroniProcess, VegaStressedBlackScholesProcess, GeneralizedOrnsteinUhlenbeckProcess, VarianceGammaProcess, GeneralizedBlackScholesProcess, CoxIngersollRossProcess, GeometricBrownianMotionProcess, HullWhiteProcess, HullWhiteForwardProcess, MfStateProcess, OrnsteinUhlenbeckProcess, SquareRootProcess, GsrProcess, and Merton76Process.
returns the expectation \( E(x_{t_0 + \Delta t} | x_{t_0} = x_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented in ExtendedOrnsteinUhlenbeckProcess, GeneralizedOrnsteinUhlenbeckProcess, GeneralizedBlackScholesProcess, CoxIngersollRossProcess, GsrProcess, HullWhiteProcess, HullWhiteForwardProcess, MfStateProcess, and OrnsteinUhlenbeckProcess.
Definition at line 78 of file stochasticprocess.cpp.
returns the standard deviation \( S(x_{t_0 + \Delta t} | x_{t_0} = x_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented in ExtendedOrnsteinUhlenbeckProcess, GemanRoncoroniProcess, GeneralizedOrnsteinUhlenbeckProcess, GeneralizedBlackScholesProcess, CoxIngersollRossProcess, GsrProcess, HullWhiteProcess, HullWhiteForwardProcess, MfStateProcess, and OrnsteinUhlenbeckProcess.
Definition at line 82 of file stochasticprocess.cpp.
returns the variance \( V(x_{t_0 + \Delta t} | x_{t_0} = x_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented in ExtendedOrnsteinUhlenbeckProcess, GeneralizedOrnsteinUhlenbeckProcess, GeneralizedBlackScholesProcess, CoxIngersollRossProcess, HullWhiteProcess, HullWhiteForwardProcess, MfStateProcess, OrnsteinUhlenbeckProcess, and GsrProcess.
Definition at line 86 of file stochasticprocess.cpp.
returns the asset value after a time interval \( \Delta t \) according to the given discretization. By default, it returns
\[ E(x_0,t_0,\Delta t) + S(x_0,t_0,\Delta t) \cdot \Delta w \]
where \( E \) is the expectation and \( S \) the standard deviation.
Reimplemented in ExtendedBlackScholesMertonProcess, GemanRoncoroniProcess, GeneralizedBlackScholesProcess, and CoxIngersollRossProcess.
Definition at line 90 of file stochasticprocess.cpp.
applies a change to the asset value. By default, it returns \( x + \Delta x \).
Reimplemented in GeneralizedBlackScholesProcess, and Merton76Process.
Definition at line 95 of file stochasticprocess.cpp.
|
overrideprivatevirtual |
returns the number of dimensions of the stochastic process
Implements StochasticProcess.
Definition at line 245 of file stochasticprocess.hpp.
|
overrideprivatevirtual |
returns the initial values of the state variables
Implements StochasticProcess.
Definition at line 249 of file stochasticprocess.hpp.
returns the drift part of the equation, i.e., \( \mu(t, \mathrm{x}_t) \)
Implements StochasticProcess.
Definition at line 254 of file stochasticprocess.hpp.
returns the diffusion part of the equation, i.e. \( \sigma(t, \mathrm{x}_t) \)
Implements StochasticProcess.
Definition at line 262 of file stochasticprocess.hpp.
returns the expectation \( E(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess.
Definition at line 270 of file stochasticprocess.hpp.
returns the standard deviation \( S(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess.
Definition at line 279 of file stochasticprocess.hpp.
returns the covariance \( V(\mathrm{x}_{t_0 + \Delta t} | \mathrm{x}_{t_0} = \mathrm{x}_0) \) of the process after a time interval \( \Delta t \) according to the given discretization. This method can be overridden in derived classes which want to hard-code a particular discretization.
Reimplemented from StochasticProcess.
Definition at line 288 of file stochasticprocess.hpp.
returns the asset value after a time interval \( \Delta t \) according to the given discretization. By default, it returns
\[ E(\mathrm{x}_0,t_0,\Delta t) + S(\mathrm{x}_0,t_0,\Delta t) \cdot \Delta \mathrm{w} \]
where \( E \) is the expectation and \( S \) the standard deviation.
Reimplemented from StochasticProcess.
Reimplemented in GemanRoncoroniProcess.
Definition at line 297 of file stochasticprocess.hpp.
applies a change to the asset value. By default, it returns \( \mathrm{x} + \Delta \mathrm{x} \).
Reimplemented from StochasticProcess.
Definition at line 307 of file stochasticprocess.hpp.
|
protected |
Definition at line 228 of file stochasticprocess.hpp.