SharpeR-package {SharpeR}R Documentation

statistics concerning Sharpe ratio and Markowitz portfolio

Description

Inference on Sharpe ratio and Markowitz portfolio.

Sharpe Ratio

Suppose xix_i are nn independent draws of a normal random variable with mean μ\mu and variance σ2\sigma^2. Let xˉ\bar{x} be the sample mean, and ss be the sample standard deviation (using Bessel's correction). Let c0c_0 be the 'risk free' or 'disastrous rate' of return. Then

z=xˉc0sz = \frac{\bar{x} - c_0}{s}

is the (sample) Sharpe ratio.

The units of zz are \mboxtime1/2\mbox{time}^{-1/2}. Typically the Sharpe ratio is annualized by multiplying by d\sqrt{d}, where dd is the number of observations per year (or whatever the target annualization epoch.) It is not common practice to include units when quoting Sharpe ratio, though doing so could avoid confusion.

The Sharpe ratio follows a rescaled non-central t distribution. That is, z/Kz/K follows a non-central t-distribution with mm degrees of freedom and non-centrality parameter ζ/K\zeta / K, for some KK, mm and ζ\zeta.

We can generalize Sharpe's model to APT, wherein we write

xi=α+jβjFj,i+ϵi,x_i = \alpha + \sum_j \beta_j F_{j,i} + \epsilon_i,

where the Fj,iF_{j,i} are observed 'factor returns', and the variance of the noise term is σ2\sigma^2. Via linear regression, one can compute estimates α^\hat{\alpha}, and σ^\hat{\sigma}, and then let the 'Sharpe ratio' be

z=α^c0σ^.z = \frac{\hat{\alpha} - c_0}{\hat{\sigma}}.

As above, this Sharpe ratio follows a rescaled t-distribution under normality, etc.

The parameters are encoded as follows:

Optimal Sharpe Ratio

Suppose xix_i are nn independent draws of a qq-variate normal random variable with mean μ\mu and covariance matrix Σ\Sigma. Let xˉ\bar{x} be the (vector) sample mean, and SS be the sample covariance matrix (using Bessel's correction). Let

Z(w)=wxˉc0wSwZ(w) = \frac{w^{\top}\bar{x} - c_0}{\sqrt{w^{\top}S w}}

be the (sample) Sharpe ratio of the portfolio ww, subject to risk free rate c0c_0.

Let ww_* be the solution to the portfolio optimization problem:

maxw:0<wSwR2Z(w),\max_{w: 0 < w^{\top}S w \le R^2} Z(w),

with maximum value z=Z(w)z_* = Z\left(w_*\right). Then

w=RS1xˉxˉS1xˉw_* = R \frac{S^{-1}\bar{x}}{\sqrt{\bar{x}^{\top}S^{-1}\bar{x}}}

and

z=xˉS1xˉc0Rz_* = \sqrt{\bar{x}^{\top} S^{-1} \bar{x}} - \frac{c_0}{R}

The variable zz_* follows an Optimal Sharpe ratio distribution. For convenience, we may assume that the sample statistic has been annualized in the same manner as the Sharpe ratio, that is by multiplying by dd, the number of observations per epoch.

The Optimal Sharpe Ratio distribution is parametrized by the number of assets, qq, the number of independent observations, nn, the noncentrality parameter,

ζ=μΣ1μ,\zeta_* = \sqrt{\mu^{\top}\Sigma^{-1}\mu},

the 'drag' term, c0/Rc_0/R, and the annualization factor, dd. The drag term makes this a location family of distributions, and by default we assume it is zero.

The parameters are encoded as follows:

Spanning and Hedging

As above, let

Z(w)=wxˉc0wSwZ(w) = \frac{w^{\top}\bar{x} - c_0}{\sqrt{w^{\top}S w}}

be the (sample) Sharpe ratio of the portfolio ww, subject to risk free rate c0c_0.

Let GG be a g×qg \times q matrix of 'hedge constraints'. Let ww_* be the solution to the portfolio optimization problem:

maxw:0<wSwR2,GSw=0Z(w),\max_{w: 0 < w^{\top}S w \le R^2,\,G S w = 0} Z(w),

with maximum value z=Z(w)z_* = Z\left(w_*\right). Then z2z_*^2 can be expressed as the difference of two squared optimal Sharpe ratio random variables. A monotonic transform takes this difference to the LRT statistic for portfolio spanning, first described by Rao, and refined by Giri.

Legal Mumbo Jumbo

SharpeR is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

Note

The following are still in the works:

  1. Corrections for standard error based on skew, kurtosis and autocorrelation.

  2. Tests on Sharpe under positivity constraint. (c.f. Silvapulle)

  3. Portfolio spanning tests.

  4. Tests on portfolio weights.

This package is maintained as a hobby.

Author(s)

Steven E. Pav shabbychef@gmail.com

References

Sharpe, William F. "Mutual fund performance." Journal of business (1966): 119-138. https://ideas.repec.org/a/ucp/jnlbus/v39y1965p119.html

Johnson, N. L., and Welch, B. L. "Applications of the non-central t-distribution." Biometrika 31, no. 3-4 (1940): 362-389. doi: 10.1093/biomet/31.3-4.362

Lo, Andrew W. "The statistics of Sharpe ratios." Financial Analysts Journal 58, no. 4 (2002): 36-52. https://www.ssrn.com/paper=377260

Opdyke, J. D. "Comparing Sharpe Ratios: So Where are the p-values?" Journal of Asset Management 8, no. 5 (2006): 308-336. https://www.ssrn.com/paper=886728

Ledoit, O., and Wolf, M. "Robust performance hypothesis testing with the Sharpe ratio." Journal of Empirical Finance 15, no. 5 (2008): 850-859. doi: 10.1016/j.jempfin.2008.03.002

Giri, N. "On the likelihood ratio test of a normal multivariate testing problem." Annals of Mathematical Statistics 35, no. 1 (1964): 181-189. doi: 10.1214/aoms/1177703740

Rao, C. R. "Advanced Statistical Methods in Biometric Research." Wiley (1952).

Rao, C. R. "On Some Problems Arising out of Discrimination with Multiple Characters." Sankhya, 9, no. 4 (1949): 343-366. https://www.jstor.org/stable/25047988

Kan, Raymond and Smith, Daniel R. "The Distribution of the Sample Minimum-Variance Frontier." Journal of Management Science 54, no. 7 (2008): 1364–1380. doi: 10.1287/mnsc.1070.0852

Kan, Raymond and Zhou, GuoFu. "Tests of Mean-Variance Spanning." Annals of Economics and Finance 13, no. 1 (2012) https://econpapers.repec.org/article/cufjournl/y_3a2012_3av_3a13_3ai_3a1_3akanzhou.htm

Britten-Jones, Mark. "The Sampling Error in Estimates of Mean-Variance Efficient Portfolio Weights." The Journal of Finance 54, no. 2 (1999): 655–671. https://www.jstor.org/stable/2697722

Silvapulle, Mervyn. J. "A Hotelling's T2-type statistic for testing against one-sided hypotheses." Journal of Multivariate Analysis 55, no. 2 (1995): 312–319. doi: 10.1006/jmva.1995.1081

Bodnar, Taras and Okhrin, Yarema. "On the Product of Inverse Wishart and Normal Distributions with Applications to Discriminant Analysis and Portfolio Theory." Scandinavian Journal of Statistics 38, no. 2 (2011): 311–331. doi: 10.1111/j.1467-9469.2011.00729.x


[Package SharpeR version 1.3.0 Index]