Learn R Programming

SharpeR (version 1.3.0)

sropt_test: test for optimal Sharpe ratio

Description

Performs one sample tests of Sharpe ratio of the Markowitz portfolio.

Usage

sropt_test(X,alternative=c("greater","two.sided","less"),
            zeta.s=0,ope=1,conf.level=0.95)

Arguments

X

a (non-empty) numeric matrix of data values, each row independent, each column representing an asset, or an object of class sropt.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided", "greater" (default) or "less". You can specify just the initial letter.

zeta.s

a number indicating the null hypothesis value.

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.

conf.level

confidence level of the interval. (not used yet)

Value

A list with class "htest" containing the following components:

statistic

the value of the \(T^2\)-statistic.

parameter

a list of the degrees of freedom for the statistic.

p.value

the p-value for the test.

conf.int

a confidence interval appropriate to the specified alternative hypothesis. NYI.

estimate

the estimated optimal Sharpe, annualized

null.value

the specified hypothesized value of the optimal Sharpe.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating what type of test was performed.

data.name

a character string giving the name(s) of the data.

Details

Suppose \(x_i\) are \(n\) independent draws of a \(q\)-variate normal random variable with mean \(\mu\) and covariance matrix \(\Sigma\). This code tests the hypothesis $$H_0: \mu^{\top}\Sigma^{-1}\mu = \delta_0^2$$

The default alternative hypothesis is the one-sided $$H_1: \mu^{\top}\Sigma^{-1}\mu > \delta_0^2$$ but this can be set otherwise.

Note there is no 'drag' term here since this represents a linear offset of the population parameter.

See ‘The Sharpe Ratio: Statistics and Applications’, section 6.3.2.

References

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

See Also

reannualize

sr_test, t.test.

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

Examples

Run this code
# NOT RUN {
# test for uniformity
pvs <- replicate(128,{ x <- sropt_test(matrix(rnorm(1000*4),ncol=4),alternative="two.sided")
                        x$p.value })
plot(ecdf(pvs))
abline(0,1,col='red') 

# input a sropt objects:
nfac <- 5
nyr <- 10
ope <- 253
# simulations with no covariance structure.
# under the null:
set.seed(as.integer(charToRaw("be determinstic")))
Returns <- matrix(rnorm(ope*nyr*nfac,mean=0,sd=0.0125),ncol=nfac)
asro <- as.sropt(Returns,drag=0,ope=ope)
stest <- sropt_test(asro,alternative="two.sided")

# }

Run the code above in your browser using DataLab