When running the command in the
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?
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?