24#ifndef quantlib_vanna_volga_interpolation_hpp
25#define quantlib_vanna_volga_interpolation_hpp
35 template<
class I1,
class I2>
class VannaVolgaInterpolationImpl;
42 template <
class I1,
class I2>
49 impl_ = ext::make_shared<
52 spot, dDiscount, fDiscount,
T);
66 template <
class I1,
class I2>
68 const I2& yBegin)
const {
81 template <
class I1,
class I2>
95 "Vanna Volga Interpolator only interpolates 3 volatilities in strike space");
101 for(
Size i = 0; i < 3; i++){
121 return std / sqrt(
T_);
124 QL_FAIL(
"Vanna Volga primitive not implemented");
127 QL_FAIL(
"Vanna Volga derivative not implemented");
130 QL_FAIL(
"Vanna Volga secondDerivative not implemented");
basic template implementation
templateImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const int requiredPoints=2)
base class for 1-D interpolations.
ext::shared_ptr< Impl > impl_
Normal distribution function.
VannaVolga-interpolation factory and traits
DiscountFactor fDiscount_
DiscountFactor dDiscount_
VannaVolga(Real spot, DiscountFactor dDiscount, DiscountFactor fDiscount, Time T)
static const Size requiredPoints
Interpolation interpolate(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin) const
Vanna Volga interpolation between discrete points
VannaVolgaInterpolation(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Real spot, DiscountFactor dDiscount, DiscountFactor fDiscount, Time T)
std::vector< Real > vegas
Real derivative(Real) const override
Real value(Real k) const override
DiscountFactor fDiscount_
Real secondDerivative(Real) const override
VannaVolgaInterpolationImpl(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, Real spot, DiscountFactor dDiscount, DiscountFactor fDiscount, Time T)
DiscountFactor dDiscount_
Real primitive(Real) const override
std::vector< Real > premiaBS
std::vector< Real > premiaMKT
#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)
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
std::size_t Size
size of a container
base class for 1-D interpolations
Real blackFormulaImpliedStdDev(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement, Real guess, Real accuracy, Natural maxIterations)
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)
normal, cumulative and inverse cumulative distributions