30 std::vector<Real> sabrParams,
40 :
SmileSection(
d, dc,
Date(), volatilityType), forward_(forward), params_(
std::move(sabrParams)),
47 "sabr expects 4 parameters (alpha,beta,nu,rho) but ("
48 <<
params_.size() <<
") given");
53 <<
") must be zero, other shifts are not implemented yet");
60 Real discount)
const {
68 Real call =
model_->digitalOptionPrice(strike);
69 return discount * (type ==
Option::Call ? call : 1.0 - call);
73 return discount *
model_->density(strike);
78 Real impliedVol = 0.0;
91 if (impliedVol == 0.0)
Real density(Rate strike, Real discount=1.0, Real gap=1.0E-4) const override
ext::shared_ptr< NoArbSabrModel > model_
NoArbSabrSmileSection(Time timeToExpiry, Rate forward, std::vector< Real > sabrParameters, Real shift=0.0, VolatilityType volatilityType=VolatilityType::ShiftedLognormal)
Real digitalOptionPrice(Rate strike, Option::Type type=Option::Call, Real discount=1.0, Real gap=1.0e-5) const override
std::vector< Real > params_
Real optionPrice(Rate strike, Option::Type type=Option::Call, Real discount=1.0) const override
Volatility volatilityImpl(Rate strike) const override
interest rate volatility smile section
virtual Time exerciseTime() const
virtual VolatilityType volatilityType() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Time
continuous quantity with 1-year units
Real unsafeSabrVolatility(Rate strike, Rate forward, Time expiryTime, Real alpha, Real beta, Real nu, Real rho, VolatilityType volatilityType)
Real blackFormulaImpliedStdDev(Option::Type optionType, Real strike, Real forward, Real blackPrice, Real discount, Real displacement, Real guess, Real accuracy, Natural maxIterations)
no arbitrage sabr smile section