23#include <ql/termstructures/volatility/abcd.hpp>
24#include <ql/math/comparison.hpp>
35 QL_REQUIRE(tMax>tMin,
"tMax must be > tMin");
36 return std::sqrt(
variance(tMin, tMax, T)/(tMax-tMin));
44 return (*
this)(T-t) * (*
this)(
S-t);
49 "integrations bounds (" << t1 <<
50 "," << t2 <<
") are in reverse order");
51 Time cutOff = std::min(
S,T);
55 cutOff = std::min(t2, cutOff);
69 return (*
this)(T-u)*(*
this)(
S-u);
74 if (T<t ||
S<t)
return 0.0;
81 Real k1=std::exp(
c_*t), k2=std::exp(
c_*
S), k3=std::exp(
c_*T);
84 + k1*k1*(1 +
c_*(
S + T - 2*t) + 2*
c_*
c_*(
S - t)*(T - t)))
85 + 2*
c_*
c_*(2*
d_*
a_*(k2 + k3)*(k1 - 1)
87 + 2*
b_*
c_*(
a_*(-1 -
c_*(
S + T) + k1*k1*(1 +
c_*(
S + T - 2*t)))
88 -2*
d_*(k3*(1 +
c_*
S) + k2*(1 +
c_*T)
89 - k1*k3*(1 +
c_*(
S - t))
90 - k1*k2*(1 +
c_*(T - t)))
Abcd functional form for instantaneous volatility
Real covariance(Time t, Time T, Time S) const
Real instantaneousVolatility(Time t, Time T) const
Real instantaneousCovariance(Time u, Time T, Time S) const
Real volatility(Time tMin, Time tMax, Time T) const
AbcdFunction(Real a=-0.06, Real b=0.17, Real c=0.54, Real d=0.17)
Real instantaneousVariance(Time t, Time T) const
Real primitive(Time t, Time T, Time S) const
Real variance(Time tMin, Time tMax, Time T) const
AbcdSquared(Real a, Real b, Real c, Real d, Time T, Time S)
ext::shared_ptr< AbcdFunction > abcd_
Real operator()(Time t) const
Real Time
continuous quantity with 1-year units
bool close(const Quantity &m1, const Quantity &m2, Size n)