## CRAN-purpose small example
smallX = matrix(rnorm(10*3),ncol=3)
smallY = matrix(rnorm(10*3),ncol=3)
eqdist.2014BG(smallX, smallY) # run the test
if (FALSE) {
## compare asymptotic and permutation-based powers
set.seed(777)
ntest = 1000
pval.a = rep(0,ntest)
pval.p = rep(0,ntest)
for (i in 1:ntest){
x = matrix(rnorm(100), nrow=5)
y = matrix(rnorm(100), nrow=5)
pval.a[i] = ifelse(eqdist.2014BG(x,y,method="a")$p.value<0.05,1,0)
pval.p[i] = ifelse(eqdist.2014BG(x,y,method="p",nreps=100)$p.value <0.05,1,0)
}
## print the result
cat(paste("\n* EMPIRICAL TYPE 1 ERROR COMPARISON \n","*\n",
"* Asymptotics : ", round(sum(pval.a/ntest),5),"\n",
"* Permutation : ", round(sum(pval.p/ntest),5),"\n",sep=""))
}
Run the code above in your browser using DataLab