sim_power_mvn {DBpower}R Documentation

sim_power_mvn.R

Description

Simulate power of detection boundary tests starting from multivariate normal test statistics.

Usage

sim_power_mvn(
  n,
  muVec,
  sigMat,
  nullSigMat = NULL,
  bounds = NULL,
  test = NULL,
  alpha
)

Arguments

n

Number of simulations.

muVec

Mean vector of test statistics under the alternative (assuming it's MVN).

sigMat

Covariance matrix of test statistics under the alternative (assuming it's MVN).

nullSigMat

Assumed correlation matrix of MVN under the null. Only need to specify if specifying test.

bounds

A 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).

test

Either "GHC", "HC", "GBJ", or "BJ" or NULL. If provided, will calculate the p-value using the specified test and calculate power this way.

alpha

Level of the test.

Value

A list with the elements:

boundsPower

Power from using bounds approach.

testPower

Power from using specific test p-value approach.

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)])
sim_power_mvn(n=1000, muVec = c(1, 0, 0, 0, 0), sigMat = myCov, alpha=0.01)


[Package DBpower version 0.1.0 Index]