calc_exact_power {DBpower}R Documentation

calc_exact_power.R

Description

For detection boundary type tests, find the power given the rejection region bounds and specification of alternative. Do not use for sets larger than 5 elements, will be too slow.

Usage

calc_exact_power(bounds, sig_mat, muVec)

Arguments

bounds

A d=J*1 vector of bounds on the magnitudes of the test statistics, where the first element is the bound for |Z|_(1) and the last element is the bound for |Z|_(J).

sig_mat

The covariance matrix of the test statistics under the alternative (assume multivariate normal).

muVec

The mean vector of the test statistics under the alternative (assume multivariate normal).

Value

A list with the elements:

power

Power under the given alternative.

errsum

Largest possible error from integration.

naSum

Number of NAs in calculating all integrals.

sumOverA

Matrix with power, errsum, naSum for each partition of the rejection region.

Examples


myCov <- matrix(data=0.3, nrow=5, ncol=5)
diag(myCov) <- 1
myBounds <- set_GBJ_bounds(alpha = 0.01, J=5, sig_vec = myCov[lower.tri(myCov)])
calc_exact_power(bounds = myBounds, sig_mat = myCov, muVec = c(1, 0, 0, 0, 0))


[Package DBpower version 0.1.0 Index]