Skip to content
Prev 4074 / 15274 Next

Calculating SharpeRatio for several managers with PerformanceAnalytics

SharpeRatio was originally written to use on a single column, but because
of the behavior of sd, which provides multi-column support, the error
isn't obvious.  Thanks very much for bringing this to our attention, we'll
provide multi-column support for this function in the next release.

To ensure column-by-column results in the meantime, you might use:
sapply(managers[,c(1,3)], FUN=SharpeRatio)
HAM1.Column HAM3.Column
  0.4481450   0.3289917
HAM1
0.448145

Sorry for the inconvenience, and thanks again for pointing this out.

pcc