0

I was calibrating Black Karasinski model using QuantLib-Python with Euro swaption at-the-money vol surface using TreeSwaptionEngine. I got the following error:

return _QuantLib.CalibratedModel_calibrate(self, *args) RuntimeError: root not bracketed: f[-50,50] -> [1.434457e-04,1.000143e+00]

Might this error be related with negative interest rates?

Does Quantlib ql.BlackKarasinski allow ShiftedLognormal option and a displacement input?

Many thanks,

Huarong

  • Normally, that error means the solver can't find a solution. Do you want to share your inputs and sample code that throws that error? – David Duarte Apr 13 '21 at 15:07
  • Many thanks, David. I will see whether I could extract a standing alone code without calling my other utility functions. My general question would be, how does this calibration consider/allow negative rates at all if there is no place to put a displacement? I can calibrate USD as the rates are positive. – huarong Apr 14 '21 at 19:24
  • The displacemente would be specified in the swaption helper, where the last two parameters are volatilityType and shift. – David Duarte Apr 15 '21 at 15:18
  • Thanks again. I have put the shiftedlognormal volatilityType and shift in the swaption helper - I verified with ql.BlackSwaptionEngine that the helper was specified correctly. This did not resolve the issue. When I read the C++ code https://rkapl123.github.io/QLAnnotatedSource/d0/d81/blackkarasinski_8hpp_source.html, I can see that shift is not allowed in the code line 82: Real variable(Time t, Rate r) const override { return std::log(r) - fitting_(t); } – huarong Apr 18 '21 at 17:28

0 Answers0