33 ext::shared_ptr<LocalVolTermStructure> leverageFct,
34 const Real mixingFactor)
35 : mixingFactor_(mixingFactor), hestonProcess_(hestonProcess),
36 leverageFct_(
std::move(leverageFct)) {
50 std::max(1e-8, std::sqrt(x[1])*
leverageFct_->localVol(
t, x[0],
true));
64 std::max(1e-8, std::sqrt(x[1])*
leverageFct_->localVol(
t, x[0],
true));
70 tmp[0][0] = vol; tmp[0][1] = 0.0;
71 tmp[1][0] =
rho_*sigma2; tmp[1][1] = sqrhov*sigma2;
85 const Real psi = s2/(m*m);
88 const Real b2 = 2/psi-1+std::sqrt(2/psi*(2/psi-1));
89 const Real b = std::sqrt(b2);
90 const Real a = m/(1+b2);
92 retVal[1] = a*(
b+dw[1])*(
b+dw[1]);
95 const Real p = (psi-1)/(psi+1);
99 retVal[1] = ((u <= p) ?
Real(0.0) : std::log((1-p)/(1-u))/
beta);
108 const Real v_0 = 0.5*(x0[1]+retVal[1])*l_0*l_0;
110 retVal[0] = x0[0]*std::exp(mu*dt - 0.5*v_0*dt
113 + 0.5*(x0[1]+retVal[1])*
kappa_*dt - x0[1])
114 + rho1*std::sqrt(v_0*dt)*dw[0]);
1-D array used in linear algebra.
Cumulative normal distribution function.
Array drift(Time t, const Array &x) const override
returns the drift part of the equation, i.e.,
Array evolve(Time t0, const Array &x0, Time dt, const Array &dw) const override
Matrix diffusion(Time t, const Array &x) const override
returns the diffusion part of the equation, i.e.
const Handle< YieldTermStructure > & dividendYield() const
const ext::shared_ptr< LocalVolTermStructure > leverageFct_
HestonSLVProcess(const ext::shared_ptr< HestonProcess > &hestonProcess, ext::shared_ptr< LocalVolTermStructure > leverageFct, Real mixingFactor=1.0)
const ext::shared_ptr< HestonProcess > hestonProcess_
const Handle< YieldTermStructure > & riskFreeRate() const
Matrix used in linear algebra.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
ext::function< Real(Real)> b
Real Time
continuous quantity with 1-year units
Real Volatility
volatility
Heston stochastic local volatility process.
normal, cumulative and inverse cumulative distributions
risk neutral terminal density calculator for the square root process