# 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?

• Hello Henk and welcome to SE. The best way to get help quickly and efficiently is ot provide a reproducible example. That is, an example that one can run to get to the same error message that you mention. In your case for example, volMatrix is missing. One thing though, try setting your evaluation date in this way: setEvaluationDate(as.Date('2018-09-28')) for example. – byouness Feb 20 at 16:22
• One more thing, ts should be a term structure, not a number. check for example ?DiscountCurve – byouness Feb 20 at 16:35
• 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 – Henk van Elst Feb 21 at 13:49

## 1 Answer

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.