尝试从“RQuantLib”包中运行以下示例代码...
require(RQuantLib)
HullWhite <- list(term = 0.055, alpha = 0.03, sigma = 0.01,
gridIntervals = 40)
Price <- rep(as.double(100),24)
Type <- rep(as.character("C"), 24)
Date <- seq(as.Date("2006-09-15"), by = '3 months', length = 24)
callSch <- data.frame(Price, Type, Date)
callSch$Type <- as.character(callSch$Type)
bondparams <- list(faceAmount=100, issueDate = as.Date("2004-09-16"),
maturityDate=as.Date("2012-09-16"), redemption=100,
callSch = callSch)
dateparams <- list(settlementDays=3, calendar="us",
dayCounter = "ActualActual",
period="Quarterly",
businessDayConvention = "Unadjusted",
terminationDateConvention= "Unadjusted")
coupon <- c(0.0465)
CallableBond(bondparams, HullWhite, coupon, dateparams)
...我收到以下错误:
SET_VECTOR_ELT() can only be applied to a 'list', not a 'symbol'
通过互联网徘徊,我发现了与我的问题类似的问题,已通过更新软件包解决。我尝试了相同但没有结果;我也在三台不同的电脑上试过:(
两周前,相同的代码可以正常工作。知道在此期间发生了什么变化吗?
谢谢 :)