diff --git a/ql/termstructures/yield/fittedbonddiscountcurve.cpp b/ql/termstructures/yield/fittedbonddiscountcurve.cpp index 89cb076f1e..79468915c2 100644 --- a/ql/termstructures/yield/fittedbonddiscountcurve.cpp +++ b/ql/termstructures/yield/fittedbonddiscountcurve.cpp @@ -322,8 +322,7 @@ namespace QuantLib { Array values(n + N); for (Size i=0; i helper = fittingMethod_->curve_->bondHelpers_[i]; - Real error = helper->impliedQuote() - helper->quote()->value(); - Real weightedError = fittingMethod_->weights_[i] * error; + Real weightedError = fittingMethod_->weights_[i] * helper->quoteError(); values[i] = weightedError * weightedError; }