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, ...)
ope drag has been annualized,
i.e. is given in the same units as x and
q.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.
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:
df1.df2.zeta.s.ope.drag.reannualize F-distribution functions, df, pf,
qf, rf, Sharpe ratio distribution,
dsr, psr, qsr, rsr.
Other sropt: as.sropt,
as.sropt.default,
as.sropt.xts, confint.sr,
confint.sropt, is.sropt,
power.sropt_test,
reannualize, reannualize.sr,
reannualize.sropt, sropt,
sropt_test
# 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