我有一个函数,它创建一个不同统计数据的列表,计算如下:
RiskStats = list(stdev,sharpe,downdev,sortino,maxDD,calmar,currDD)
> RiskStats
[[1]]
Index
StdDev 3.2506
[[2]]
Index
Annualized Sharpe Ratio (Rf=0%) -1.2434
[[3]]
Index
Downside Deviation (MAR = 0%) 3.194
[[4]]
Index
Sortino Ratio (MAR = 0%) -1.2655
[[5]]
Index
maxDD -8.9467
[[6]]
Index
Calmar Ratio -0.44846
[[7]]
Index
Current DD -8.543
我想为这个列表设置一个结构(7行1列),我们可以简单地写
dim(RiskStats) <- c(7,1)
为什么在我们得到的某些结果 [List,1] 的结果中,而不是计算出的正确统计量?
> RiskStats
Index
Annual volatility 3.2506
Sharpe ratio -1.2434
Downside deviation 3.194
Sortino ratio -1.2655
Maximum Drawdown List,1
Calmar ratio -0.44846
Current drawdown List,1