25#include <boost/math/distributions/non_central_chi_squared.hpp>
26#include <boost/math/special_functions/gamma.hpp>
45 typedef boost::math::non_central_chi_squared_distribution<Real>
48 const Real kTilde =
X(strike);
52 return f0_ * (1.0 - boost::math::cdf(
54 - strike * boost::math::cdf(
59 boost::math::gamma_p(0.5*
delta_-1.0,
x0_/(2.0*
t));
61 return f0_ * (g - boost::math::cdf(
63 - strike * boost::math::cdf(
69 return -
f0_ * boost::math::cdf(
71 + strike * (1.0 - boost::math::cdf(
75 return -
f0_ * boost::math::cdf(
77 + strike * (1.0 - boost::math::cdf(
98 "not an European option");
100 ext::shared_ptr<StrikedTypePayoff>
payoff =
101 ext::dynamic_pointer_cast<StrikedTypePayoff>(arguments_.payoff);
104 const Date exerciseDate = arguments_.exercise->lastDate();
Pricing engine for European vanilla options using a constant elasticity of variance (CEV) model.
const YieldTermStructure & discountCurve_
const Instrument::results * results_
const Handle< YieldTermStructure > discountCurve_
void calculate() const override
AnalyticCEVEngine(Real f0, Real alpha, Real beta, Handle< YieldTermStructure > discountCurve)
const ext::shared_ptr< CEVCalculator > calculator_
constant elasticity of variance process (absorbing boundary at f=0)
CEVCalculator(Real f0, Real alpha, Real beta)
Real value(Option::Type optionType, Real strike, Time t) const
Shared handle to an observable.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Option exercise classes and payoff function.
const ext::shared_ptr< CEVCalculator > calculator_
Real Time
continuous quantity with 1-year units
ext::shared_ptr< QuantLib::Payoff > payoff
functionals and combinators not included in the STL