calculate a traditional or modified Sharpe Ratio of Return over StdDev or VaR or ES
Source:R/SharpeRatio.R
SharpeRatio.RdThe Sharpe ratio is simply the return per unit of risk (represented by variability). In the classic case, the unit of risk is the standard deviation of the returns.
Arguments
- R
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
- Rf
risk free rate, in same period as your returns
- p
confidence level for calculation, default p=.95
- FUN
one of "StdDev" or "VaR" or "ES" to use as the denominator
- weights
portfolio weighting vector, default NULL, see Details in
VaR- annualize
if TRUE, annualize the measure, default FALSE
- geometric
utilize geometric chaining (TRUE) or simple/arithmetic chaining (FALSE) to aggregate returns, default FALSE
- SE
TRUE/FALSE whether to ouput the standard errors of the estimates of the risk measures, default FALSE.
- SE.control
Control parameters for the computation of standard errors. Should be done using the
RPESE.controlfunction.- ...
any other passthru parameters to the VaR or ES functions
Details
$$\frac{\overline{(R_{a}-R_{f})}}{\sqrt{\sigma_{(R_{a}-R_{f})}}}$$
William Sharpe now recommends InformationRatio preferentially
to the original Sharpe Ratio.
The higher the Sharpe ratio, the better the combined performance of "risk" and return.
As noted, the traditional Sharpe Ratio is a risk-adjusted measure of return that uses standard deviation to represent risk.
The Sharpe Ratio can be used to measure both 'excess return' (over a risk-free rate) and 'differential return' (excess return over a benchmark).
A number of papers now recommend using a "modified Sharpe" ratio using a Modified Cornish-Fisher VaR or CVaR/Expected Shortfall as the measure of Risk.
We have extended this concept to create multivariate modified
Sharpe-like Ratios for standard deviation, Gaussian VaR, modified VaR,
Gaussian Expected Shortfall, and modified Expected Shortfall. See
VaR and ES. You can pass additional arguments
to VaR and ES via ... The most important is
probably the 'method' argument/
Most recently, we have added Downside Sharpe Ratio (DSR) (see DownsideSharpeRatio), a short name for what Ziemba (2005)
called the "Symmetric Downside Risk Sharpe Ratio" and is defined as the ratio of the mean return
to the square root of lower semivariance:
$$\frac{\overline{(R_{a}-R_{f})}}{\sqrt{2}SemiSD(R_a)}$$.
This function returns a traditional or modified Sharpe ratio for the same periodicity of the data being input (e.g., monthly data -> monthly SR)
References
Sharpe, W.F. The Sharpe Ratio,Journal of Portfolio Management,Fall 1994, 49-58.
Laurent Favre and Jose-Antonio Galeano. Mean-Modified Value-at-Risk Optimization with Hedge Funds. Journal of Alternative Investment, Fall 2002, v 5.
Ziemba, W. T. (2005). The symmetric downside-risk Sharpe ratio. The Journal of Portfolio Management, 32(1), 108-122.
Jacquier, E., Kane, A., Marcus, A. [2003]. Geometric Mean or Arithmetic Mean: A Reconsideration. Financial Analysts Journal, November/December 2003, p. 46-53.
Examples
data(managers)
SharpeRatio(managers[, 1, drop = FALSE], Rf = .035 / 12, FUN = "StdDev")
#> HAM1
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.3201889
SharpeRatio(managers[, 1, drop = FALSE], Rf = managers[, 10, drop = FALSE], FUN = "StdDev")
#> HAM1
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.3083031
SharpeRatio(managers[, 1:6], Rf = .035 / 12, FUN = "StdDev")
#> HAM1 HAM2 HAM3 HAM4
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.3201889 0.3057649 0.2610141 0.1522615
#> HAM5 HAM6
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.02562009 0.3417545
SharpeRatio(managers[, 1:6], Rf = managers[, 10, drop = FALSE], FUN = "StdDev")
#> HAM1 HAM2 HAM3 HAM4
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.3083031 0.3007347 0.2543159 0.1461686
#> HAM5 HAM6
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.03541442 0.3790978
data(edhec)
SharpeRatio(edhec[, 6, drop = FALSE], FUN = "VaR")
#> Event Driven
#> VaR Sharpe Ratio (Rf=0%, p=95%): 0.2254086
SharpeRatio(edhec[, 6, drop = FALSE], Rf = .04 / 12, FUN = "VaR")
#> Event Driven
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.1014122
SharpeRatio(edhec[, 6, drop = FALSE], Rf = .04 / 12, FUN = "VaR", method = "gaussian")
#> Event Driven
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.1194134
SharpeRatio(edhec[, 6, drop = FALSE], FUN = "ES")
#> Event Driven
#> ES Sharpe Ratio (Rf=0%, p=95%): 0.08225819
# and all the methods
SharpeRatio(managers[, 1:9], Rf = managers[, 10, drop = FALSE], FUN = c("StdDev", "VaR", "ES"))
#> HAM1 HAM2 HAM3 HAM4
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.3083031 0.3007347 0.2543159 0.14616861
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.2121978 0.3534141 0.2306110 0.09188612
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.1231747 0.1780009 0.1949678 0.06436764
#> HAM5 HAM6 EDHEC LS EQ SP500 TR
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.03541442 0.3790978 0.3159045 0.12575679
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.02288896 0.2842869 0.2397510 0.07589660
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.01586730 0.2188594 0.1670072 0.05548862
#> US 10Y TR
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.05704891
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.03440630
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.02516771
SharpeRatio(edhec, Rf = .04 / 12, FUN = c("StdDev", "VaR", "ES"))
#> Convertible Arbitrage CTA Global
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.14668811 0.04318355
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.08473647 0.02781876
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.02650981 0.02251161
#> Distressed Securities Emerging Markets
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.19243015 0.10385437
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.11142378 0.05984235
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.04941172 0.02853645
#> Equity Market Neutral Event Driven
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.12208608 0.17516507
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.06997339 0.10141223
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.02503004 0.03954982
#> Fixed Income Arbitrage Global Macro
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.09571851 0.1548462
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.05204721 0.1321156
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.01943961 0.1115701
#> Long/Short Equity Merger Arbitrage
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.16187593 0.19589976
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.10303277 0.12245783
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.06518853 0.04115638
#> Relative Value Short Selling Funds of Funds
#> Sharpe Ratio (Rf=0.3%, p=95%): 0.20179571 -0.10095636 0.07325342
#> VaR Sharpe Ratio (Rf=0.3%, p=95%): 0.11568877 -0.07015128 0.04458660
#> ES Sharpe Ratio (Rf=0.3%, p=95%): 0.04710276 -0.06481548 0.02393051