View source: R/distributions.r
pco_sropt | R Documentation |
Distribution function and quantile function for the 'confidence
distribution' of the maximal Sharpe ratio. This is just an inversion
to perform inference on \zeta_*
given observed statistic
z_*
.
pco_sropt(q,df1,df2,z.s,ope,lower.tail=TRUE,log.p=FALSE)
qco_sropt(p,df1,df2,z.s,ope,lower.tail=TRUE,log.p=FALSE,lb=0,ub=Inf)
q |
vector of quantiles. |
df1 |
the number of assets in the portfolio. |
df2 |
the number of observations. |
z.s |
an observed Sharpe ratio statistic, annualized. |
ope |
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 |
lower.tail |
logical; if TRUE (default), probabilities are
|
log.p |
logical; if TRUE, probabilities p are given as |
p |
vector of probabilities. |
lb |
the lower bound for the output of |
ub |
the upper bound for the output of |
Suppose z_*
follows a Maximal Sharpe ratio distribution
(see SharpeR-package
) for known degrees of freedom, and
unknown non-centrality parameter \zeta_*
. The
'confidence distribution' views \zeta_*
as a random
quantity once z_*
is observed. As such, the CDF of
the confidence distribution is the same as that of the
Maximal Sharpe ratio (up to a flip of lower.tail
);
while the quantile function is used to compute confidence
intervals on \zeta_*
given z_*
.
pco_sropt
gives the distribution function, and
qco_sropt
gives the quantile function.
Invalid arguments will result in return value NaN
with a warning.
When lower.tail
is true, pco_sropt
is monotonic increasing
with respect to q
, and decreasing in sropt
; these are reversed
when lower.tail
is false. Similarly, qco_sropt
is increasing
in sign(as.double(lower.tail) - 0.5) * p
and
- sign(as.double(lower.tail) - 0.5) * sropt
.
Steven E. Pav shabbychef@gmail.com
reannualize
dsropt,psropt,qsropt,rsropt
Other sropt:
as.sropt()
,
confint.sr()
,
dsropt()
,
is.sropt()
,
power.sropt_test()
,
reannualize()
,
sropt
,
sropt_test()
zeta.s <- 2.0
ope <- 253
ntest <- 50
df1 <- 4
df2 <- 6 * ope
rvs <- rsropt(ntest,df1=df1,df2=df2,zeta.s=zeta.s)
qvs <- seq(0,10,length.out=51)
pps <- pco_sropt(qvs,df1,df2,rvs[1],ope)
if (require(txtplot))
txtplot(qvs,pps)
pps <- pco_sropt(qvs,df1,df2,rvs[1],ope,lower.tail=FALSE)
if (require(txtplot))
txtplot(qvs,pps)
svs <- seq(0,4,length.out=51)
pps <- pco_sropt(2,df1,df2,svs,ope)
pps <- pco_sropt(2,df1,df2,svs,ope,lower.tail=FALSE)
pps <- pco_sropt(qvs,df1,df2,rvs[1],ope,lower.tail=FALSE)
pco_sropt(-1,df1,df2,rvs[1],ope)
qvs <- qco_sropt(0.05,df1=df1,df2=df2,z.s=rvs)
mean(qvs > zeta.s)
qvs <- qco_sropt(0.5,df1=df1,df2=df2,z.s=rvs)
mean(qvs > zeta.s)
qvs <- qco_sropt(0.95,df1=df1,df2=df2,z.s=rvs)
mean(qvs > zeta.s)
# test vectorization:
qv <- qco_sropt(0.1,df1,df2,rvs)
qv <- qco_sropt(c(0.1,0.2),df1,df2,rvs)
qv <- qco_sropt(c(0.1,0.2),c(df1,2*df1),df2,rvs)
qv <- qco_sropt(c(0.1,0.2),c(df1,2*df1),c(df2,2*df2),rvs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.