27#include <boost/math/special_functions/gamma.hpp>
28#include <boost/math/distributions/non_central_chi_squared.hpp>
43 return 1.0-boost::math::gamma_p(-0.5*
delta_+1.0,
x0_/(2.0*
t));
54 1.0/(2.0*(1.0-
beta_)));
61 return boost::math::pdf(
62 boost::math::non_central_chi_squared_distribution<Real>(
66 return boost::math::pdf(
67 boost::math::non_central_chi_squared_distribution<Real>(
76 return 1.0 - boost::math::cdf(
77 boost::math::non_central_chi_squared_distribution<Real>(
80 return 1.0 - boost::math::cdf(
81 boost::math::non_central_chi_squared_distribution<Real>(
89 c = std::max(c, -0.45*
b);
93 const Real m = (h-1)*(1-3*h);
95 const Real u = (std::pow(a/(
b+c), h) - (1 + h*p*(h-1-0.5*(2-h)*m*p)))/
96 (h*std::sqrt(2*p)*(1+0.5*m*p));
116 invX(brent.
solve(cdfApprox, 1e-8, y0, 0.02*y0) *
t);
125 const Real x =
t * boost::math::quantile(
126 boost::math::non_central_chi_squared_distribution<Real>(
risk neutral density calculator for the constant elasticity of variance (CEV) model
CEVRNDCalculator(Real f0, Real alpha, Real beta)
Real pdf(Real f, Time t) const override
Real massAtZero(Time t) const
Real invcdf(Real q, Time t) const override
Real cdf(Real f, Time t) const override
Real sankaranApprox(Real f, Time t, Real x) const
Inverse cumulative normal distribution function.
Real inverseCDF(Real p, Time t) const
void setMaxEvaluations(Size evaluations)
Real solve(const F &f, Real accuracy, Real guess, Real step) const
Classes and functions for error handling.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
ext::function< Real(Real)> b
Real Time
continuous quantity with 1-year units
functionals and combinators not included in the STL
normal, cumulative and inverse cumulative distributions
ext::shared_ptr< YieldTermStructure > q