20#include <ql/experimental/processes/extendedornsteinuhlenbeckprocess.hpp>
21#include <ql/math/integrals/gausslobattointegral.hpp>
22#include <ql/processes/ornsteinuhlenbeckprocess.hpp>
33 integrand(ext::function<
Real(
Real)> b,
Real speed) : b(
std::move(b)), speed(speed) {}
35 return b(x) * std::exp(speed*x);
48 : speed_(speed), vol_(vol), b_(
std::move(b)), intEps_(intEps),
50 QL_REQUIRE(
speed_ >= 0.0,
"negative a given");
51 QL_REQUIRE(
vol_ >= 0.0,
"negative volatility given");
89 +
b_(t0+0.5*dt)*(1.0 - std::exp(-
speed_*dt));
100 + bt-ex*bu - (bt-bu)/(
speed_*dt)*(1-ex);
110 QL_FAIL(
"unknown discretization scheme");
ExtendedOrnsteinUhlenbeckProcess(Real speed, Volatility sigma, Real x0, ext::function< Real(Real)> b, Discretization discretization=MidPoint, Real intEps=1e-4)
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_
const ext::function< Real(Real)> b_
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
const Discretization discretization_
Real x0() const override
returns the initial value of the state variable
Real variance(Time t0, Real x0, Time dt) const override
Integral of a one-dimensional function.
Ornstein-Uhlenbeck process class.
discretization of a stochastic process over a given time interval
Real Time
continuous quantity with 1-year units
Real Volatility
volatility