我正在尝试使用 R 中的 PerformanceAnalytics 包计算返回系列的 sharpRatio。我的数据如下所示:
head(simpleRet)
2006-01-02 2006-01-03 2006-01-04 2006-01-05 2006-01-06 2006-01-09
0.000000000 0.002495244 0.001018385 -0.001903177 0.002254347 0.002000196
并且是类动物园。我正在使用代码:
library("PerformanceAnalytics")
SharpeRatio(simpleRet, Rf = 0.05, p = 0.95, FUN = "StdDev", weights = NULL, annualize = TRUE)
print(YY)
但我收到以下错误消息:
Error in FUNCT(R = R, p = p, ... = ..., invert = FALSE) :
'x' needs to be timeBased or xtsible, or scale must be specified.
有什么建议么?