###########################################################################
#### This is the file to reproduce the simulations (Section 3.1-3.2) ######
###########################################################################

###################################################
# Load the function "simulation" and the packages #
###################################################

source("SupplementaryFile3.r")

library(globalboosttest)
library(globaltest)
goeman<-function(X,Y,Z)
{
globaltest(X=t(X),Y=Y,adjust=Z)
}

################
# Setting null #
################
null<-simulation(nrun=100,muX=0,muZ=0,prel=0,nperm=200,mstop=c(100,500,1000))


##############
# Setting a) #
##############
mux0.5prel5<-simulation(nrun=100,muX=0.5,muZ=0,prel=5,nperm=200,mstop=c(100,500,1000))

##############
# Setting b) #
##############
mux0.8prel5<-simulation(nrun=100,muX=0.8,muZ=0,prel=5,nperm=200,mstop=c(100,500,1000))

##############
# Setting c) #
##############
mux0.3prel50<-simulation(nrun=100,muX=0.3,muZ=0,prel=50,nperm=200,mstop=c(100,500,1000))

##############
# Setting d) #
##############
mux0.5prel50<-simulation(nrun=100,muX=0.5,muZ=0,prel=50,nperm=200,mstop=c(100,500,1000))

##############
# Setting e) #
##############
mux0.3prel200<-simulation(nrun=100,muX=0.3,muZ=0,prel=200,nperm=200,mstop=c(100,500,1000))

################
# Setting f.1) #
################
mux1prel5<-simulation(nrun=100,muX=1,muZ=1,prel=5,XeqZ=FALSE,nperm=200,mstop=c(100,500,1000))

################
# Setting f.2) #
################
mux1prel5eq<-simulation(nrun=100,muX=1,muZ=1,prel=5,XeqZ=TRUE,nperm=200,mstop=c(100,500,1000))

