56 tmp[0][0] = sigma1; tmp[0][1] = 0.0;
57 tmp[1][0] =
rho_*sigma1; tmp[1][1] = std::sqrt(1.0-
rho_*
rho_)*sigma2;
80 Real expa = std::exp(-
a_*dt), expb = std::exp(-
b_*dt);
87 tmp[1][0] = newRho*sigma2;
88 tmp[1][1] = std::sqrt(1.0-newRho*newRho)*sigma2;
151 tmp[0][0] = sigma1; tmp[0][1] = 0.0;
152 tmp[1][0] =
rho_*sigma1; tmp[1][1] = std::sqrt(1.0-
rho_*
rho_)*sigma2;
168 Real expa = std::exp(-
a_*dt), expb = std::exp(-
b_*dt);
175 tmp[1][0] = newRho*sigma2;
176 tmp[1][1] = std::sqrt(1.0-newRho*newRho)*sigma2;
205 * (1-std::exp(-
a_*(
t-
s)));
207 (std::exp(-
a_*(
T-
t))-std::exp(-
a_*(
T+
t-2*
s)));
216 * (1-std::exp(-
b_*(
t-
s)));
218 (std::exp(-
b_*(
T-
t))-std::exp(-
b_*(
T+
t-2*
s)));
1-D array used in linear algebra.
ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcess > xProcess_
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
ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcess > yProcess_
Matrix diffusion(Time t, const Array &x) const override
returns the diffusion part of the equation, i.e.
Matrix stdDeviation(Time t0, const Array &x0, Time dt) const override
Real My_T(Real s, Real t, Real T) const
Real yForwardDrift(Time t, Time T) const
Real Mx_T(Real s, Real t, Real T) const
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
Real xForwardDrift(Time t, Time T) const
G2ForwardProcess(Real a, Real sigma, Real b, Real eta, Real rho)
ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcess > xProcess_
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
ext::shared_ptr< QuantLib::OrnsteinUhlenbeckProcess > yProcess_
Matrix diffusion(Time t, const Array &x) const override
returns the diffusion part of the equation, i.e.
G2Process(Real a, Real sigma, Real b, Real eta, Real rho)
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
Matrix used in linear algebra.
Ornstein-Uhlenbeck process class.
Euler discretization for stochastic processes.
ext::function< Real(Real)> b
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Matrix transpose(const Matrix &m)