26 class BlackCalibrationHelper::ImpliedVolatilityHelper {
28 ImpliedVolatilityHelper(
const BlackCalibrationHelper& helper,
30 :
helper_(helper), value_(value) {}
33 return value_ -
helper_.blackPrice(x);
36 const BlackCalibrationHelper&
helper_;
46 ImpliedVolatilityHelper
f(*
this,targetValue);
71 if (modelPrice <= lowerPrice)
73 else if (modelPrice >= upperPrice)
77 modelPrice, 1e-12, 5000, minVol, maxVol);
82 QL_FAIL(
"unknown Calibration Error Type");
Calibration helper class.
Handle< Quote > volatility_
Volatility impliedVolatility(Real targetValue, Real accuracy, Size maxEvaluations, Volatility minVol, Volatility maxVol) const
Black volatility implied by the model.
virtual Real modelValue() const =0
returns the price of the instrument according to the model
Real calibrationError() override
returns the error resulting from the model valuation
Real marketValue() const
returns the actual price of the instrument (from volatility)
const CalibrationErrorType calibrationErrorType_
const VolatilityType volatilityType_
virtual Real blackPrice(Volatility volatility) const =0
Black or Bachelier price given a volatility.
void setMaxEvaluations(Size evaluations)
Real solve(const F &f, Real accuracy, Real guess, Real step) const
ResettingLegHelper helper_
#define QL_FAIL(message)
throw an error (possibly with file and line information)
Real Volatility
volatility
std::size_t Size
size of a container