QuantLib
QuantLib copied to clipboard
Option pricing BARONE-ADESI/WHALEY and negative rate
Problem: If rate is negative (I used -0.012 - 0.12%), the BAW option pricing crashed with this error message: forward + displacement (-3.875e+14 + 0) must be positive
Code: https://github.com/lballabio/QuantLib/blob/master/ql/pricingengines/vanilla/baroneadesiwhaleyengine.cpp#L115
To reproduce this problem, use the sample code EquityOption.cpp and changed the riskfree to -0.012 and you'll get:
Option type = Put Maturity = May 17th, 1999 Underlying price = 36 Strike = 40 Risk-free interest rate = -1.200000 % Dividend yield = 0.000000 % Volatility = 20.000000 %
Method European Bermudan American August 20th, 1998 November 20th, 1998 February 20th, 1999 May 20th, 1999 Black-Scholes 5.781564 N/A N/A Black Vasicek Model 5.274950 N/A N/A Heston semi-analytic 5.781563 N/A N/A Bates semi-analytic 5.781563 N/A N/A forward + displacement (-3.875e+14 + 0) must be positive
So, what is the expected behavior when the rate is negative?
If the model can’t handle negative rates then at the very least we should add a QL_REQUIRE to check the value, similar to how there is already a non-negative check on the spot value in the calculate method.
what is the fix here? is it about adding a QL_REQUIRE to check the value? Thanks.