29 const ext::shared_ptr<discretization>&
d,
32 discretization_(evolDisc) {}
50 Real predictor, sigma0, sigma1;
53 Real driftterm, diffusionterm, corrector;
75 - 0.5*std::pow(sigma0,2);
81 - 0.5*std::pow(sigma1,2);
82 driftterm = 0.5*rate1+0.5*rate0;
83 diffusionterm = 0.5*(sigma1+sigma0);
85 apply(
x0,driftterm*dt+diffusionterm*std::sqrt(dt)*dw);
89 QL_FAIL(
"unknown discretization scheme");
ExtendedBlackScholesMertonProcess(const Handle< Quote > &x0, const Handle< YieldTermStructure > ÷ndTS, const Handle< YieldTermStructure > &riskFreeTS, const Handle< BlackVolTermStructure > &blackVolTS, const ext::shared_ptr< discretization > &d=ext::shared_ptr< discretization >(new EulerDiscretization), Discretization evolDisc=Milstein)
Real diffusion(Time t, Real x) const override
returns the diffusion part of the equation, i.e.
Real evolve(Time t0, Real x0, Time dt, Real dw) const override
Real drift(Time t, Real x) const override
returns the drift part of the equation, i.e.
const Discretization discretization_
Generalized Black-Scholes stochastic process.
Real apply(Real x0, Real dx) const override
const Handle< YieldTermStructure > & dividendYield() const
Real stdDeviation(Time t0, Real x0, Time dt) const override
Real expectation(Time t0, Real x0, Time dt) const override
const Handle< BlackVolTermStructure > & blackVolatility() const
Real x0() const override
returns the initial value of the state variable
const Handle< YieldTermStructure > & riskFreeRate() const
Shared handle to an observable.
#define QL_FAIL(message)
throw an error (possibly with file and line information)
experimental Black-Scholes-Merton process
@ NoFrequency
null frequency
Real Time
continuous quantity with 1-year units