Learn R Programming

SharpeR (version 1.3.0)

predint: prediction interval for Sharpe ratio

Description

Computes the prediction interval for Sharpe ratio.

Usage

predint(
  x,
  oosdf,
  oosrescal = 1/sqrt(oosdf + 1),
  ope = NULL,
  level = 0.95,
  level.lo = (1 - level)/2,
  level.hi = 1 - level.lo,
  type = c("t", "Z", "Mertens", "Bao")
)

Arguments

x

a (non-empty) numeric vector of data values, or an object of class sr.

oosdf

the future (or 'out of sample', thus 'oos') degrees of freedom. In the vanilla Sharpe case, this is the number of future observations minus one.

oosrescal

the rescaling parameter for the future Sharpe ratio. The default value holds for the case of unattributed models ('vanilla Shape'), but can be set to some other value to deal with the magnitude of attribution factors in the future period.

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 to take the same ope from the input x object, if it is unambiguous.

level

the confidence level required.

level.lo

the lower confidence level required.

level.hi

the upper confidence level required.

type

which method to apply. Only methods based on an approximate standard error are supported.

Value

A matrix (or vector) with columns giving lower and upper confidence limits for the parameter. These will be labelled as level.lo and level.hi in %, e.g. "2.5 %"

Details

Given \(n_0\) observations \(x_i\) from a normal random variable, with mean \(\mu\) and standard deviation \(\sigma\), computes an interval \([y_1,y_2]\) such that with a fixed probability, the sample Sharpe ratio over \(n\) future observations will fall in the given interval. The coverage is over repeated draws of both the past and future data, thus this computation takes into account error in both the estimate of Sharpe and the as yet unrealized returns. Coverage is approximate. Prediction intervals are computed by inflating a confidence interval by an amount which depends on the sample sizes.

See ‘The Sharpe Ratio: Statistics and Applications’, sections 2.5.9 and 3.5.2.

References

Pav, S. E. "The Sharpe Ratio: Statistics and Applications." CRC Press, 2021.

Sharpe, William F. "Mutual fund performance." Journal of business (1966): 119-138. https://ideas.repec.org/a/ucp/jnlbus/v39y1965p119.html

See Also

confint.sr.

Other sr: as.sr(), confint.sr(), dsr(), is.sr(), plambdap(), power.sr_test(), print.sr(), reannualize(), se(), sr_equality_test(), sr_test(), sr_unpaired_test(), sr_vcov(), sr, summary.sr

Examples

Run this code
# NOT RUN {
# should reject null
set.seed(1234)
etc <- predint(rnorm(1000,mean=0.5,sd=0.1),oosdf=127,ope=1)
etc <- predint(matrix(rnorm(1000*5,mean=0.05),ncol=5),oosdf=63,ope=1)

# check coverage
mu <- 0.0005
sg <- 0.013
n1 <- 512
n2 <- 256
p  <- 100
x1 <- matrix(rnorm(n1*p,mean=mu,sd=sg),ncol=p)
x2 <- matrix(rnorm(n2*p,mean=mu,sd=sg),ncol=p)
sr1 <- as.sr(x1)
sr2 <- as.sr(x2)
# check coverage of prediction interval
etc1 <- predint(sr1,oosdf=n2-1,level=0.95)
is.ok <- (etc1[,1] <= sr2$sr) & (sr2$sr <= etc1[,2])
covr <- mean(is.ok)

# }

Run the code above in your browser using DataLab