RQuantLib Bermudan Swaptions and Negative Rate Limitations
Summary
The document reports two problems with RQuantLib’s Bermudan swaption function: an error saying the effective date is at or beyond the termination date, followed by rejection of a negative zero rate when the term structure is supplied. The question includes trade, settlement, start, and maturity dates along with swaption expiry and tenor grids, but the responses do not establish that these inputs caused the first error.
The accepted answer relates the negative-rate failure to a lognormal interest-rate representation, which cannot directly accommodate negative values inside the logarithm. It notes that the discussed Bermudan implementation appears not to expose a displacement parameter that could address this limitation. The answer is directional rather than a complete diagnosis: it points to a related QuantLib discussion but does not provide corrected parameters, a working alternative model, or a verified fix for the effective-date error.
Key ideas
- The question presents an effective-date versus termination-date error in Bermudan swaption pricing.
- A separate failure occurs when negative zero rates enter the term structure.
- The answer links the negative-rate limitation to a lognormal rate representation.
- A displacement adjustment may be unavailable in the implementation discussed.
- The response does not resolve the date error or demonstrate an alternative pricing setup.
Tags
Full text
# RQuantLib: BermudanSwaption(): effective date later than or equal to termination date
# RQuantLib: BermudanSwaption(): effective date later than or equal to termination date
When running the command in the `RQuantLib` library:
```
pricing <- BermudanSwaption(params , ts = 0.0429353,
swaptionMaturities, swapTenors, volMatrix)
```
It returns the following cryptic error:
```
Error in bermudanFromYieldEngine(params, ts, swaptionMaturities, swapTenors, :
effective date (October 5th, 2038) later than or equal to termination date (October 5th, 2038)
```
I suppose this error message relates to my parameter specifications:
```
params <- list(tradeDate = as.Date('2018-09-28'),
settleDate = as.Date('2018-10-01'),
startDate = as.Date('2019-10-01'),
maturity = as.Date('2031-02-28'),
dt = 1)
```
which are likely to be mutually inconsistent.
Perhaps, I should also mention that I used market data for a volatility matrix of format:
```
# in years
swaptionMaturities <- c( 1/12 , 1/6 , 1/4 , 1/2 , 3/4 , 1 , 3/2 ,
2 , 3 , 4 , 5 , 7 , 10 , 15 , 20 , 25 , 30 )
# in years
swapTenors <- c( 1:10 , 15 , 20 , 25 , 30 )
```
Could somebody please fill me in?
Many thanks.
Thanks for your comment. Its been helpful, also as regards the term structure not being a number. In the meantime my problem has shifted somewhat. It appears that the function BermudanSwaption() cannot handle negative interest rates in the term structure, not even with the two Hull-White options:
pricing <- BermudanSwaption( params , ts , swaptionMaturities , swapTenors , volMatrix )
Error in bermudanWithRebuiltCurveEngine(params, c(ts$table$date), ts$table$zeroRates, : invalid value (-0.00376213) at index 0.
When I take the negative interest rates out of my term structure input, my problem appears to go away. But isn't it the whole point of the Hull-White approach to be able to handle negative interest rates?
## Answer by MonteCarloSims (score 1, accepted)
https://quant.stackexchange.com/a/44191
I attempted an answer to a similar QuantLib negative interest rate question here.
I think you'll find that the answer to your question is similar. However, in the Github Bermudan code I do not see a similar 'Displacement' variable to my previous answer. It appears that the problem of negative interest in QuantLib derives from not being able to place a negative number in a logarithm - therefore not allowing for a lognormal interest rate structure.
I realize this probably isn't the answer you were looking for, but hopefully it sets you on the right path towards working with negative interest rates in RQuantLib.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.