In the first step, we generate a simple dataset. where C1 and C2 are dominated by C3, C3 is dominated by C4, and is C4 dominated by C5. There is no dominant-distribution relation between C1 and C2.
# Simulation section
nInv<-100
initMean=10
stepMean=20
std=8
simData1<-c()
simData1$Values<-rnorm(nInv,mean=initMean,sd=std)
simData1$Group<-rep(c("C1"),times=nInv)
simData1$Values<-c(simData1$Values,rnorm(nInv,mean=initMean,sd=std) )
simData1$Group<-c(simData1$Group,rep(c("C2"),times=nInv))
simData1$Values<-c(simData1$Values,rnorm(nInv,mean=initMean+2*stepMean,sd=std) )
simData1$Group<-c(simData1$Group,rep(c("C3"),times=nInv) )
simData1$Values<-c(simData1$Values,rnorm(nInv,mean=initMean+3*stepMean,sd=std) )
simData1$Group<-c(simData1$Group, rep(c("C4"),times=nInv) )
simData1$Values<-c(simData1$Values,rnorm(nInv,mean=initMean+4*stepMean,sd=std) )
simData1$Group<-c(simData1$Group, rep(c("C5"),times=nInv) )The framework is used to analyze the data below.
## Loading required package: boot
# parameter setting
bootT=1000 # Number of times of sampling with replacement
alpha=0.05 # significance significance level
#======= input
Values=simData1$Values
Group=simData1$Group
#=============
A1<-EDOIF(Values,Group,bootT = bootT, alpha=alpha )We print the result of our framework below.
## EDOIF (Empirical Distribution Ordering Inference Framework)
## =======================================================
## Alpha = 0.050000, Number of bootstrap resamples = 1000, CI type = perc
## Using Mann-Whitney test to report whether A ≺ B
## A dominant-distribution network density:1.000000
## Distribution: C2
## Mean:8.188994 95CI:[ 6.819728,9.536961]
## Distribution: C1
## Mean:10.871532 95CI:[ 9.538109,12.276580]
## Distribution: C3
## Mean:51.238612 95CI:[ 49.460537,52.970902]
## Distribution: C4
## Mean:68.750621 95CI:[ 67.284604,70.141253]
## Distribution: C5
## Mean:89.144684 95CI:[ 87.427257,90.722985]
## =======================================================
## Mean difference of C1 (n=100) minus C2 (n=100): C2 ≺ C1
## :p-val 0.0021
## Mean Diff:2.682538 95CI:[ 0.770592,4.727405]
##
## Mean difference of C3 (n=100) minus C2 (n=100): C2 ≺ C3
## :p-val 0.0000
## Mean Diff:43.049618 95CI:[ 40.831537,45.231141]
##
## Mean difference of C4 (n=100) minus C2 (n=100): C2 ≺ C4
## :p-val 0.0000
## Mean Diff:60.561627 95CI:[ 58.686947,62.357729]
##
## Mean difference of C5 (n=100) minus C2 (n=100): C2 ≺ C5
## :p-val 0.0000
## Mean Diff:80.955690 95CI:[ 78.870424,83.020312]
##
## Mean difference of C3 (n=100) minus C1 (n=100): C1 ≺ C3
## :p-val 0.0000
## Mean Diff:40.367080 95CI:[ 38.231535,42.614695]
##
## Mean difference of C4 (n=100) minus C1 (n=100): C1 ≺ C4
## :p-val 0.0000
## Mean Diff:57.879088 95CI:[ 55.922815,59.731400]
##
## Mean difference of C5 (n=100) minus C1 (n=100): C1 ≺ C5
## :p-val 0.0000
## Mean Diff:78.273152 95CI:[ 76.035505,80.352099]
##
## Mean difference of C4 (n=100) minus C3 (n=100): C3 ≺ C4
## :p-val 0.0000
## Mean Diff:17.512008 95CI:[ 15.191536,19.625572]
##
## Mean difference of C5 (n=100) minus C3 (n=100): C3 ≺ C5
## :p-val 0.0000
## Mean Diff:37.906072 95CI:[ 35.538635,40.235484]
##
## Mean difference of C5 (n=100) minus C4 (n=100): C4 ≺ C5
## :p-val 0.0000
## Mean Diff:20.394064 95CI:[ 18.220754,22.564531]
The first plot is the plot of mean-difference confidence intervals
The second plot is the plot of mean confidence intervals
The third plot is a dominant-distribution network.
We generate more complicated dataset of mixture distributions. C1, C2, C3, and C4 are dominated by C5. There is no dominant-distribution relation among C1, C2, C3, and C4.
library(EDOIF)
# parameter setting
bootT=1000
alpha=0.05
nInv<-1200
start_time <- Sys.time()
#======= input
simData3<-SimNonNormalDist(nInv=nInv,noisePer=0.01)
Values=simData3$Values
Group=simData3$Group
#=============
A3<-EDOIF(Values,Group, bootT=bootT, alpha=alpha, methodType ="perc")
A3## EDOIF (Empirical Distribution Ordering Inference Framework)
## =======================================================
## Alpha = 0.050000, Number of bootstrap resamples = 1000, CI type = perc
## Using Mann-Whitney test to report whether A ≺ B
## A dominant-distribution network density:0.400000
## Distribution: C3
## Mean:79.874249 95CI:[ 77.859092,81.762246]
## Distribution: C2
## Mean:80.719075 95CI:[ 78.859773,82.467151]
## Distribution: C1
## Mean:81.575253 95CI:[ 79.934530,83.082652]
## Distribution: C4
## Mean:81.837282 95CI:[ 79.769066,84.003936]
## Distribution: C5
## Mean:141.699138 95CI:[ 139.736626,143.755197]
## =======================================================
## Mean difference of C2 (n=1200) minus C3 (n=1200): C3 ⊀ C2
## :p-val 0.4272
## Mean Diff:0.844826 95CI:[ -1.675021,3.586544]
##
## Mean difference of C1 (n=1200) minus C3 (n=1200): C3 ⊀ C1
## :p-val 0.3389
## Mean Diff:1.701004 95CI:[ -0.826179,4.298753]
##
## Mean difference of C4 (n=1200) minus C3 (n=1200): C3 ⊀ C4
## :p-val 0.3162
## Mean Diff:1.963033 95CI:[ -0.955123,4.913663]
##
## Mean difference of C5 (n=1200) minus C3 (n=1200): C3 ≺ C5
## :p-val 0.0000
## Mean Diff:61.824890 95CI:[ 59.131746,64.595700]
##
## Mean difference of C1 (n=1200) minus C2 (n=1200): C2 ⊀ C1
## :p-val 0.3920
## Mean Diff:0.856178 95CI:[ -1.663763,3.326786]
##
## Mean difference of C4 (n=1200) minus C2 (n=1200): C2 ⊀ C4
## :p-val 0.3831
## Mean Diff:1.118207 95CI:[ -1.415120,3.809133]
##
## Mean difference of C5 (n=1200) minus C2 (n=1200): C2 ≺ C5
## :p-val 0.0000
## Mean Diff:60.980064 95CI:[ 58.202584,63.707514]
##
## Mean difference of C4 (n=1200) minus C1 (n=1200): C1 ⊀ C4
## :p-val 0.4793
## Mean Diff:0.262029 95CI:[ -2.473593,3.023061]
##
## Mean difference of C5 (n=1200) minus C1 (n=1200): C1 ≺ C5
## :p-val 0.0000
## Mean Diff:60.123886 95CI:[ 57.543503,62.488019]
##
## Mean difference of C5 (n=1200) minus C4 (n=1200): C4 ≺ C5
## :p-val 0.0000
## Mean Diff:59.861857 95CI:[ 57.147007,62.827475]
## Time difference of 2.605843 secs
Generating \(A\) dominates \(B\) with different degrees of uniform noise
library(ggplot2)
nInv<-1000
simData3<-SimNonNormalDist(nInv=nInv,noisePer=0.01)
#plot(density(simData3$V3))
dat <- data.frame(dens = c(simData3$V3, simData3$V5)
, lines = rep(c("B", "A"), each = nInv))
#Plot.
p1<-ggplot(dat, aes(x = dens, fill = lines)) + geom_density(alpha = 0.5) +xlim(-400, 400)+ ylim(0, 0.07) + ylab("Density [0,1]") +xlab("Values") + theme( axis.text.x = element_text(face="bold",
size=12) )
theme_update(text = element_text(face="bold", size=12) )
p1$labels$fill<-"Categories"
plot(p1)## Warning: Removed 2 rows containing non-finite outside the scale range
## (`stat_density()`).