
Compute power of test, or determine parameters to obtain target power.
power.sr_test(n=NULL,zeta=NULL,sig.level=0.05,power=NULL,
alternative=c("one.sided","two.sided"),ope=NULL)
Object of class power.htest
, a list of the arguments
(including the computed one) augmented with method
, note
and n.epoch
elements, the latter is the number of epochs
under the given annualization (ope
), NA
if none given.
Number of observations
the 'signal-to-noise' parameter, defined as the population mean divided by the population standard deviation, 'annualized'.
Significance level (Type I error probability).
Power of test (1 minus Type II error probability).
One- or two-sided test.
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.
Steven E. Pav shabbychef@gmail.com
Suppose you perform a single-sample test for significance of the
Sharpe ratio based on the corresponding single-sample t-test.
Given any three of: the effect size (the population SNR,
See ‘The Sharpe Ratio: Statistics and Applications’, section 2.5.8.
This is a thin wrapper on power.t.test
.
Exactly one of the parameters n
, zeta
, power
, and
sig.level
must be passed as NULL, and that parameter is determined
from the others. Notice that sig.level
has non-NULL default, so NULL
must be explicitly passed if you want to compute it.
Sharpe, William F. "Mutual fund performance." Journal of business (1966): 119-138. https://ideas.repec.org/a/ucp/jnlbus/v39y1965p119.html
Johnson, N. L., and Welch, B. L. "Applications of the non-central t-distribution." Biometrika 31, no. 3-4 (1940): 362-389. tools:::Rd_expr_doi("10.1093/biomet/31.3-4.362")
Pav, S. E. "The Sharpe Ratio: Statistics and Applications." CRC Press, 2021.
Lehr, R. "Sixteen S-squared over D-squared: A relation for crude sample size estimates." Statist. Med., 11, no 8 (1992): 1099--1102. tools:::Rd_expr_doi("10.1002/sim.4780110811")
reannualize
power.t.test
, sr_test
Other sr:
as.sr()
,
confint.sr()
,
dsr()
,
is.sr()
,
plambdap()
,
predint()
,
print.sr()
,
reannualize()
,
se()
,
sr
,
sr_equality_test()
,
sr_test()
,
sr_unpaired_test()
,
sr_vcov()
,
summary.sr
anex <- power.sr_test(253,1,0.05,NULL,ope=253)
anex <- power.sr_test(n=253,zeta=NULL,sig.level=0.05,power=0.5,ope=253)
anex <- power.sr_test(n=NULL,zeta=0.6,sig.level=0.05,power=0.5,ope=253)
# Lehr's Rule
zetas <- seq(0.1,2.5,length.out=51)
ssizes <- sapply(zetas,function(zed) {
x <- power.sr_test(n=NULL,zeta=zed,sig.level=0.05,power=0.8,
alternative="two.sided",ope=253)
x$n / 253})
# should be around 8.
print(summary(ssizes * zetas * zetas))
# e = n z^2 mnemonic approximate rule for 0.05 type I, 50% power
ssizes <- sapply(zetas,function(zed) {
x <- power.sr_test(n=NULL,zeta=zed,sig.level=0.05,power=0.5,ope=253)
x$n / 253 })
print(summary(ssizes * zetas * zetas - exp(1)))
Run the code above in your browser using DataLab