Density, distribution function, quantile function and random
generation for the maximal Sharpe ratio distribution with
df1
and df2
degrees of freedom
(and optional maximal signal-noise-ratio zeta.s
).
dsropt(x, df1, df2, zeta.s, ope, drag = 0, log = FALSE)psropt(q, df1, df2, zeta.s, ope, drag = 0, ...)
qsropt(p, df1, df2, zeta.s, ope, drag = 0, ...)
rsropt(n, df1, df2, zeta.s, ope, drag = 0, ...)
vector of quantiles.
the number of assets in the portfolio.
the number of observations.
the non-centrality parameter, defined as \(\zeta_* = \sqrt{\mu^{\top}\Sigma^{-1}\mu},\) for population parameters. defaults to 0, i.e. a central maximal Sharpe ratio distribution.
the number of observations per 'epoch'. For convenience of
interpretation, The Sharpe ratio is typically quoted in 'annualized'
units for some epoch, that is, 'per square root epoch', though returns
are observed at a frequency of ope
per epoch.
The default value is 1, meaning the code will not attempt to guess
what the observation frequency is, and no annualization adjustments
will be made.
the 'drag' term, \(c_0/R\). defaults to 0. It is assumed
that drag
has been annualized, i.e. is given in the
same units as x
and q
.
logical; if TRUE, densities \(f\) are given as \(\mbox{log}(f)\).
vector of probabilities.
number of observations.
arguments passed on to the respective Hotelling \(T^2\) functions.
dsropt
gives the density, psropt
gives the distribution function,
qsropt
gives the quantile function, and rsropt
generates random deviates.
Invalid arguments will result in return value NaN
with a warning.
Suppose \(x_i\) are \(n\) independent draws of a \(q\)-variate normal random variable with mean \(\mu\) and covariance matrix \(\Sigma\). Let \(\bar{x}\) be the (vector) sample mean, and \(S\) be the sample covariance matrix (using Bessel's correction). Let $$Z(w) = \frac{w^{\top}\bar{x} - c_0}{\sqrt{w^{\top}S w}}$$ be the (sample) Sharpe ratio of the portfolio \(w\), subject to risk free rate \(c_0\).
Let \(w_*\) be the solution to the portfolio optimization problem: $$\max_{w: 0 < w^{\top}S w \le R^2} Z(w),$$ with maximum value \(z_* = Z\left(w_*\right)\). Then $$w_* = R \frac{S^{-1}\bar{x}}{\sqrt{\bar{x}^{\top}S^{-1}\bar{x}}}$$ and $$z_* = \sqrt{\bar{x}^{\top} S^{-1} \bar{x}} - \frac{c_0}{R}$$
The variable \(z_*\) 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 \(d\), the number of observations per epoch.
The Optimal Sharpe Ratio distribution is parametrized by the number of assets, \(q\), the number of independent observations, \(n\), the noncentrality parameter, $$\zeta_* = \sqrt{\mu^{\top}\Sigma^{-1}\mu},$$ the 'drag' term, \(c_0/R\), and the annualization factor, \(d\). The drag term makes this a location family of distributions, and by default we assume it is zero.
The parameters are encoded as follows:
\(q\) is denoted by df1
.
\(n\) is denoted by df2
.
\(\zeta_*\) is denoted by zeta.s
.
\(d\) is denoted by ope
.
\(c_0/R\) is denoted by drag
.
See ‘The Sharpe Ratio: Statistics and Applications’, section 6.1.4.
Kan, Raymond and Smith, Daniel R. "The Distribution of the Sample Minimum-Variance Frontier." Journal of Management Science 54, no. 7 (2008): 1364--1380. 10.1287/mnsc.1070.0852
Pav, S. E. "The Sharpe Ratio: Statistics and Applications." CRC Press, 2021.
F-distribution functions, df, pf, qf, rf
,
Sharpe ratio distribution, dsr, psr, qsr, rsr
.
Other sropt:
as.sropt()
,
confint.sr()
,
is.sropt()
,
pco_sropt()
,
power.sropt_test()
,
reannualize()
,
sropt_test()
,
sropt
# NOT RUN {
# generate some variates
ngen <- 128
ope <- 253
df1 <- 8
df2 <- ope * 10
drag <- 0
# sample
rvs <- rsropt(ngen, df1, df2, drag, ope)
hist(rvs)
# these should be uniform:
isp <- psropt(rvs, df1, df2, drag, ope)
plot(ecdf(isp))
# }
Run the code above in your browser using DataLab