1
我試圖計算的使用R. 包PerformanceAnalytics我的數據看起來如下返回系列sharpRatio:SharpeRatio在PortfolioAnalytics包中的R
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
,是一流的動物園。使用 I'mm代碼:
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.
有什麼建議?