尝试从'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'
在互联网上徘徊,我发现类似于我的问题的东西已经通过更新包解决了。我尝试了相同但没有结果;我也在三台不同的电脑上试过它:(
两周前,相同的代码正常运行。 关于在此期间发生了什么变化的任何想法?
谢谢:)