Learn R Programming

SharpeR (version 0.1306)

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,
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
conf.level
confidence level of the interval. (not used yet)

Value

  • A list with class "htest" containing the following components:
  • statisticthe value of the $T^2$-statistic.
  • parametera list of the degrees of freedom for the statistic.
  • p.valuethe p-value for the test.
  • conf.inta confidence interval appropriate to the specified alternative hypothesis. NYI.
  • estimatethe estimated optimal Sharpe, annualized
  • null.valuethe specified hypothesized value of the optimal Sharpe.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string indicating what type of test was performed.
  • data.namea 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_0: \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 Also

reannualize

sr_test, t.test.

Other sropt: as.sropt, as.sropt.default, as.sropt.xts, confint.sr, confint.sropt, dsropt, is.sropt, power.sropt_test, reannualize, reannualize.sr, reannualize.sropt, sropt

Examples

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

Run the code above in your browser using DataLab