【发布时间】:2015-04-25 23:52:25
【问题描述】:
我正在尝试使用 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.
有什么建议吗?
【问题讨论】: