Learn R Programming

SharpeR (version 1.4.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)

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.

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 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.

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.

Author

Steven E. Pav shabbychef@gmail.com

Details

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_*\).

See Also

reannualize

dsropt,psropt,qsropt,rsropt

Other sropt: as.sropt(), confint.sr(), dsropt(), is.sropt(), power.sropt_test(), reannualize(), sropt, sropt_test()

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)
# \donttest{
if (require(txtplot))
 txtplot(qvs,pps)
# }
pps <- pco_sropt(qvs,df1,df2,rvs[1],ope,lower.tail=FALSE)
# \donttest{
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