sr_unpaired_test: test for equation on unpaired Sharpe ratios

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

View source: R/tests.r

Description

Performs hypothesis tests on a single equation on k independent samples of Sharpe ratio.

Usage

1
2
3
sr_unpaired_test(srs,contrasts=NULL,null.value=0,
  alternative=c("two.sided","less","greater"),
  ope=NULL,conf.level=0.95)

Arguments

srs

a (non-empty) list of objects of class sr, each containing a scalar sample Sharpe estimate. Or a single object of class sr with multiple Sharpe estimates. If the sr objects have different annualizations (ope parameters), a warning is thrown, since it is presumed that the contrasts all have the same units, but the test proceeds.

contrasts

an array of the constrasts, the a_j values. Defaults to c(1,-1,1,...).

null.value

the constant null value, the b. Defaults to 0.

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.

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 srs object, if it is unambiguous. Otherwise, it defaults to 1, with a warning thrown.

conf.level

confidence level of the interval.

...

further arguments to be passed to or from methods.

Details

For 1 <= j <= k, suppose you have n_j observations of a normal random variable with mean mu_j and standard deviation sigma_j, with all observations independent. Given constants a_j and value b, this code tests the null hypothesis

H0: sum_j a_j mu_j/sigma_j = b

against two or one sided alternatives.

Value

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

statistic

NULL here.

parameter

a list of upsilon parameters.

p.value

the p-value for the test.

conf.int

a confidence interval appropriate to the specified alternative hypothesis.

estimate

the estimated equation value, just the weighted sum of the sample Sharpe ratios. Annualized

null.value

the specified hypothesized value of the sum of Sharpes.

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.

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

Pav, Steven. "Inference on the Sharpe ratio via the upsilon distribution.' Arxiv (2015). http://arxiv.org/abs/1505.00829

See Also

sr_equality_test, sr_test, t.test.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# basic usage
set.seed(as.integer(charToRaw("set the seed")))
# default contrast is 1,-1,1,-1,1,-1
etc <- sr_unpaired_test(as.sr(matrix(rnorm(1000*6,mean=0.02,sd=0.1),ncol=6)))
print(etc)

etc <- sr_unpaired_test(as.sr(matrix(rnorm(1000*4,mean=0.0005,sd=0.01),ncol=4)),
  alternative='greater')
print(etc)

etc <- sr_unpaired_test(as.sr(matrix(rnorm(1000*4,mean=0.0005,sd=0.01),ncol=4)),
  contrasts=c(1,1,1,1),null.value=-0.1,alternative='greater')
print(etc)

inp <- list(as.sr(rnorm(500)),as.sr(runif(200)-0.5),
            as.sr(rnorm(30)),as.sr(rnorm(100)))
etc <- sr_unpaired_test(inp)

inp <- list(as.sr(rnorm(500)),as.sr(rnorm(100,mean=0.2,sd=1)))
etc <- sr_unpaired_test(inp,contrasts=c(1,1),null.value=0.2)
etc$conf.int

SharpeR documentation built on May 29, 2017, 5:15 p.m.