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.
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns
risk free rate, in same period as your returns
confidence level for calculation, default p=.95
one of "StdDev" or "VaR" or "ES" to use as the denominator
portfolio weighting vector, default NULL, see Details in
VaR
if TRUE, annualize the measure, default FALSE
TRUE/FALSE whether to ouput the standard errors of the estimates of the risk measures, default FALSE.
Control parameters for the computation of standard errors. Should be done using the RPESE.control function.
any other passthru parameters to the VaR or ES functions
$$\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.
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)
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.
data(managers)
SharpeRatio(managers[,1,drop=FALSE], Rf=.035/12, FUN="StdDev")
#> HAM1
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.3201889
SharpeRatio(managers[,1,drop=FALSE], Rf = managers[,10,drop=FALSE], FUN="StdDev")
#> HAM1
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.308102
SharpeRatio(managers[,1:6], Rf=.035/12, FUN="StdDev")
#> HAM1 HAM2 HAM3 HAM4
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.3201889 0.3057649 0.2610141 0.1522615
#> HAM5 HAM6
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.02562009 0.3417545
SharpeRatio(managers[,1:6], Rf = managers[,10,drop=FALSE], FUN="StdDev")
#> HAM1 HAM2 HAM3 HAM4
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.308102 0.2988608 0.2525301 0.1464385
#> HAM5 HAM6
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.0354554 0.3785371
data(edhec)
SharpeRatio(edhec[, 6, drop = FALSE], FUN="VaR")
#> Event Driven
#> VaR Sharpe (Rf=0%, p=95%): 0.2254086
SharpeRatio(edhec[, 6, drop = FALSE], Rf = .04/12, FUN="VaR")
#> Event Driven
#> VaR Sharpe (Rf=0.3%, p=95%): 0.1128292
SharpeRatio(edhec[, 6, drop = FALSE], Rf = .04/12, FUN="VaR" , method="gaussian")
#> Event Driven
#> VaR Sharpe (Rf=0.3%, p=95%): 0.135566
SharpeRatio(edhec[, 6, drop = FALSE], FUN="ES")
#> Event Driven
#> ES Sharpe (Rf=0%, p=95%): 0.08225819
# and all the methods
SharpeRatio(managers[,1:9], Rf = managers[,10,drop=FALSE])
#> HAM1 HAM2 HAM3 HAM4
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.3081020 0.2988608 0.2525301 0.14643845
#> VaR Sharpe (Rf=0.3%, p=95%): 0.2306863 0.3970699 0.2504936 0.09553906
#> ES Sharpe (Rf=0.3%, p=95%): 0.1295014 0.1788256 0.2093343 0.06625013
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.2939322 NA 0.2756616 0.13937238
#> HAM5 HAM6 EDHEC LS EQ SP500 TR
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.03545540 0.3785371 0.3142695 0.12558293
#> VaR Sharpe (Rf=0.3%, p=95%): 0.02399862 0.3022965 0.2737607 0.07957460
#> ES Sharpe (Rf=0.3%, p=95%): 0.01664487 0.2308450 0.1855867 0.05760917
#> SemiSD Sharpe (Rf=0.3%, p=95%): NA NA NA 0.11811218
#> US 10Y TR
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.05684359
#> VaR Sharpe (Rf=0.3%, p=95%): 0.03741555
#> ES Sharpe (Rf=0.3%, p=95%): 0.02610548
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.05544425
SharpeRatio(edhec,Rf = .04/12)
#> Convertible Arbitrage CTA Global
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.14668811 0.04318355
#> VaR Sharpe (Rf=0.3%, p=95%): 0.09573383 0.03071283
#> ES Sharpe (Rf=0.3%, p=95%): 0.02749804 0.02436990
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.12742933 0.04448386
#> Distressed Securities Emerging Markets
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.19243015 0.10385437
#> VaR Sharpe (Rf=0.3%, p=95%): 0.12468723 0.06357551
#> ES Sharpe (Rf=0.3%, p=95%): 0.05185797 0.02935853
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.16964280 0.09420548
#> Equity Market Neutral Event Driven
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.12208608 0.17516507
#> VaR Sharpe (Rf=0.3%, p=95%): 0.09119925 0.11282916
#> ES Sharpe (Rf=0.3%, p=95%): 0.02730312 0.04117466
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.10912571 0.15387917
#> Fixed Income Arbitrage Global Macro
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.09571851 0.1548462
#> VaR Sharpe (Rf=0.3%, p=95%): 0.06182798 0.1640095
#> ES Sharpe (Rf=0.3%, p=95%): 0.02066033 0.1334925
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.07810721 0.1724268
#> Long/Short Equity Merger Arbitrage
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.16187593 0.19589976
#> VaR Sharpe (Rf=0.3%, p=95%): 0.11467174 0.14961866
#> ES Sharpe (Rf=0.3%, p=95%): 0.06966206 0.04383052
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.15390702 0.17840739
#> Relative Value Short Selling Funds of Funds
#> StdDev Sharpe (Rf=0.3%, p=95%): 0.20179571 -0.10095636 0.07325342
#> VaR Sharpe (Rf=0.3%, p=95%): 0.13789129 -0.07391375 0.05102233
#> ES Sharpe (Rf=0.3%, p=95%): 0.05040732 -0.06801430 0.02566824
#> SemiSD Sharpe (Rf=0.3%, p=95%): 0.17429478 -0.10985959 0.06968278