36 const std::pair<Real, Real>& cPoint)
42 const Real upperBound =
43 scaleFactor*rndCalculator.
invcdf(1-eps, maturity);
47 const Real lowerBound = (massAtZero > eps)
49 :
Real(rndCalculator.
invcdf(eps, maturity)/scaleFactor);
52 ext::shared_ptr<Fdm1dMesher> helper;
54 && cPoint.first >= lowerBound && cPoint.first <= upperBound) {
56 helper = ext::make_shared<Concentrating1dMesher>(
57 lowerBound, upperBound,
size, cPoint);
60 helper = ext::make_shared<Uniform1dMesher>(
61 lowerBound, upperBound,
size );
64 std::copy(helper->locations().begin(),
65 helper->locations().end(),
69 dplus_[i] = helper->dplus(i);
risk neutral density calculator for the constant elasticity of variance (CEV) model
constant elasticity of variance process (absorbing boundary at f=0)
Real massAtZero(Time t) const
Real invcdf(Real q, Time t) const override
std::vector< Real > locations_
std::vector< Real > dplus_
std::vector< Real > dminus_
FdmCEV1dMesher(Size size, Real f0, Real alpha, Real beta, Time maturity, Real eps=0.0001, Real scaleFactor=1.5, const std::pair< Real, Real > &cPoint=(std::pair< Real, Real >(Null< Real >(), Null< Real >())))
template class providing a null value for a given type.
One-dimensional grid mesher concentrating around critical points.
One-dimensional mesher for the CEV model.
Real Time
continuous quantity with 1-year units
std::size_t Size
size of a container
Maps shared_ptr to either the boost or std implementation.