Am 08.08.2012 09:54, schrieb Cren:
# Hi all,
# trying to run the following example code
# from 'RQuantLib' package...
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)
> # ...I get the following error:
> # ---> SET_VECTOR_ELT() can only be applied to a 'list', not a
> 'symbol'
I cannot reproduce this error. I get
Concise summary of valuation for CallableBond
Net present value : 64.73968
clean price : 64.003
dirty price : 64.74
accrued coupon : 0.73689
yield : 9.2989
cash flows :
Date Amount
2004-12-16 1.1561
2005-03-16 1.1460
2005-06-16 1.1721
2005-09-16 1.1721
##...
> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C
[5] LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RQuantLib_0.3.8 Rcpp_0.9.13
Regards,
Enrico
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.