25 : reversion_(reversion), times_(times), vols_(vols) {
29 "number of volatilities ("
30 << vols.
size() <<
") compared to number of times ("
32 for (
int i = 0; i < ((int)times.
size()) - 1; i++)
33 QL_REQUIRE(times[i] < times[i + 1],
"times must be increasing ("
34 << times[i] <<
"@" << i
35 <<
" , " << times[i + 1]
36 <<
"@" << i + 1 <<
")");
37 for (
Size i = 0; i < vols.
size(); i++)
38 QL_REQUIRE(vols[i] >= 0.0,
"volatilities must be non negative ("
39 << vols[i] <<
"@" << i <<
")");
77 for (
Size k = i; k < j; k++) {
85 std::max(k > 0 ?
times_[k - 1] : 0.0,
t)));
90 (
t + dt - std::max(j > 0 ?
times_[j - 1] : 0.0,
t));
95 (std::max(j > 0 ?
times_[j - 1] : 0.0,
t))));
1-D array used in linear algebra.
bool empty() const
whether the array is empty
const_iterator end() const
Size size() const
dimension of the array
const_iterator begin() const
MfStateProcess(Real reversion, const Array ×, const Array &vols)
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
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
Real variance(Time t0, Real x0, Time dt) const override
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
LinearInterpolation variance
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
State process for markov functional model.
ext::shared_ptr< BlackVolTermStructure > v