sr_equality_test: Paired test for equality of Sharpe ratio

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tests.r

Description

Performs a hypothesis test of equality of Sharpe ratios of p assets given paired observations.

Usage

1
2
3
4
sr_equality_test(X,type=c("chisq","F","t"),
                 alternative=c("two.sided","less","greater"),
                 contrasts=NULL,
                 vcov.func=vcov)

Arguments

X

an n x p matrix of paired observations.

type

which approximation to use. "chisq" is preferred when the returns are non-normal, but the approximation is asymptotic. the "t" test is only supported when k = 1.

alternative

a character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". You can specify just the initial letter. This is only relevant for the "t" test. "greater" corresponds to Ha: E s > 0.

contrasts

an k x p matrix of the contrasts

vcov.func

a function which takes a model of class lm (one of the form x ~ 1), and produces a variance-covariance matrix. The default is vcov, which produces a 'vanilla' estimate of covariance. Other sensible options are vcovHAC from the sandwich package.

Details

Given n i.i.d. observations of the excess returns of p strategies, we test

H0: sr1 = sr2 = ...

using the method of Wright, et. al.

More generally, a matrix of constrasts, E can be given, and we can test

H0: E s = 0,

where s is the vector of Sharpe ratios of the p strategies.

When E consists of a single row (a single contrast), as is the case when the default contrasts are used and only two strategies are compared, then an approximate t-test can be performed against the alternative hypothesis Ha: E s > 0

Both chi-squared and F- approximations are supported; the former is described by Wright. et. al., the latter by Leung and Wong.

Value

Object of class htest, a list of the test statistic, the size of X, and the method noted.

Author(s)

Steven E. Pav [email protected]

References

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

Wright, J. A., Yam, S. C. P., and Yung, S. P. "A note on the test for the equality of multiple Sharpe ratios and its application on the evaluation of iShares." J. Risk. to appear. http://www.risk.net/journal-of-risk/technical-paper/2340067/a-test-for-the-equality-of-multiple-sharpe-ratios

Leung, P.-L., and Wong, W.-K. "On testing the equality of multiple Sharpe ratios, with application on the evaluation of iShares." J. Risk 10, no. 3 (2008): 15–30. http://papers.ssrn.com/sol3/papers.cfm?abstract_id=907270

Memmel, C. "Performance hypothesis testing with the Sharpe ratio." Finance Letters 1 (2003): 21–23.

Ledoit, O., and Wolf, M. "Robust performance hypothesis testing with the Sharpe ratio." Journal of Empirical Finance 15, no. 5 (2008): 850-859. http://www.ledoit.net/jef2008_abstract.htm

Lo, Andrew W. "The statistics of Sharpe ratios." Financial Analysts Journal 58, no. 4 (2002): 36-52. http://ssrn.com/paper=377260

See Also

sr_test

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# under the null 
rv <- sr_equality_test(matrix(rnorm(500*5),ncol=5))
# under the alternative (but with identity covariance)
ope <- 253
nyr <- 10
nco <- 5
rets <- 0.01 * sapply(seq(0,1.7/sqrt(ope),length.out=nco),
  function(mu) { rnorm(ope*nyr,mean=mu,sd=1) })
rv <- sr_equality_test(rets)

## Not run: 
# using real data
if (require(quantmod)) {
  get.ret <- function(sym,...) {
    OHLCV <- getSymbols(sym,auto.assign=FALSE,...)
    lrets <- diff(log(OHLCV[,paste(c(sym,"Adjusted"),collapse=".",sep="")]))
    lrets[-1,]
  }
  get.rets <- function(syms,...) { some.rets <- do.call("cbind",lapply(syms,get.ret,...)) }
  some.rets <- get.rets(c("IBM","AAPL","NFLX","SPY"))
  pvs <- sr_equality_test(some.rets)
}
# test for uniformity
pvs <- replicate(1024,{ x <- sr_equality_test(matrix(rnorm(400*5),400,5),type="chisq")
                       x$p.value })
plot(ecdf(pvs))
abline(0,1,col='red') 

## End(Not run)
## Not run: 
if (require(sandwich)) {
  set.seed(as.integer(charToRaw("0b2fd4e9-3bdf-4e3e-9c75-25c6d18c331f")))
  n.manifest <- 10
  n.latent <- 4
  n.day <- 1024
  snr <- 0.95
  latent.rets <- matrix(rnorm(n.day*n.latent),ncol=n.latent) %*%
	matrix(runif(n.latent*n.manifest),ncol=n.manifest)
  noise.rets <- matrix(rnorm(n.day*n.manifest),ncol=n.manifest)
  some.rets <- snr * latent.rets + sqrt(1-snr^2) * noise.rets
  # naive vcov
  pvs0 <- sr_equality_test(some.rets)
  # HAC vcov
  pvs1 <- sr_equality_test(some.rets,vcov.func=vcovHAC)
  # more elaborately:
  pvs <- sr_equality_test(some.rets,vcov.func=function(amod) {
	vcovHAC(amod,prewhite=TRUE) })
}

## End(Not run)

SharpeR documentation built on Oct. 8, 2018, 1:05 a.m.