Closed peterqzhang closed 7 years ago
The following code gives the error, "effective date later than or equal to termination date". The volatility matrix is the implied vol of six swaptions, 3 expiry (1,3,5 years) and 2 tenors (5, 10 years).
Please advise.
Thanks,
Peter
params <- list(tradeDate=as.Date('2017-4-11'), settleDate=as.Date('2017-4-11'), payFixed=TRUE, dt=delta_t, strike=.02, method="HWAnalytic", interpWhat="zero", interpHow= "spline")
tsQuotes <- list(d1m =0.0099, d3m = 0.0115511, d6m = 0.012219785152, d9m = 0.012942868128, d1y = 0.013466375577, s2y = 0.01557, s3y =0.01711, s5y =0.01933, s10y =0.02258, s15y =0.02422)
swaptionMaturities <- c(1,3,5) swapTenors <- c(5,10) volMatrix <- matrix( c(0.00739,0.00761, 0.0081,0.00798, 0.00825,0.00796), ncol=2, byrow=TRUE)
pricing <- RQuantLib::BermudanSwaption(params, tsQuotes, swaptionMaturities, swapTenors, volMatrix)
This error disappeared after I installed 0.4.3. The default version installed by "install.packages" is 0.4.2.
Nice.
The following code gives the error, "effective date later than or equal to termination date". The volatility matrix is the implied vol of six swaptions, 3 expiry (1,3,5 years) and 2 tenors (5, 10 years).
Please advise.
Thanks,
Peter
params <- list(tradeDate=as.Date('2017-4-11'), settleDate=as.Date('2017-4-11'), payFixed=TRUE, dt=delta_t, strike=.02, method="HWAnalytic", interpWhat="zero", interpHow= "spline")
tsQuotes <- list(d1m =0.0099, d3m = 0.0115511, d6m = 0.012219785152, d9m = 0.012942868128, d1y = 0.013466375577, s2y = 0.01557, s3y =0.01711, s5y =0.01933, s10y =0.02258, s15y =0.02422)
swaptionMaturities <- c(1,3,5) swapTenors <- c(5,10) volMatrix <- matrix( c(0.00739,0.00761, 0.0081,0.00798, 0.00825,0.00796), ncol=2, byrow=TRUE)
Pricing the Bermudan swaptions
pricing <- RQuantLib::BermudanSwaption(params, tsQuotes, swaptionMaturities, swapTenors, volMatrix)