Learn R Programming

SharpeR (version 1.0.0)

pco_sropt: The 'confidence distribution' for maximal Sharpe ratio.

Description

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_*$.

Usage

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)

Arguments

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 ope per epoc
lower.tail
logical; if TRUE (default), probabilities are $P[X \le x]$, otherwise, $P[X > x]$.
log.p
logical; if TRUE, probabilities p are given as $\mbox{log}(p)$.
p
vector of probabilities.
lb
the lower bound for the output of qco_sropt.
ub
the upper bound for the output of qco_sropt.

Value

  • pco_sropt gives the distribution function, and qco_sropt gives the quantile function.

    Invalid arguments will result in return value NaN with a warning.

Details

Suppose $z_*$ follows a Maximal Sharpe ratio distribution (see SharpeR) 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_*$.

See Also

reannualize

dsropt,psropt,qsropt,rsropt

Other sropt: as.sropt, as.sropt.default, as.sropt.xts; confint.del_sropt, confint.sr, confint.sropt; dsropt, psropt, qsropt, rsropt; is.sropt; power.sropt_test; reannualize, reannualize.sr, reannualize.sropt; sropt_test; sropt

Examples

Run this code
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)

Run the code above in your browser using DataLab