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:0.900000
## Distribution: C1
## Mean:8.953663 95CI:[ 7.376662,10.530461]
## Distribution: C2
## Mean:9.804163 95CI:[ 8.203839,11.461919]
## Distribution: C3
## Mean:50.555920 95CI:[ 48.891783,52.296528]
## Distribution: C4
## Mean:69.804912 95CI:[ 68.234391,71.265248]
## Distribution: C5
## Mean:90.164858 95CI:[ 88.538284,91.810009]
## =======================================================
## Mean difference of C2 (n=100) minus C1 (n=100): C1 ⊀ C2
## :p-val 0.2496
## Mean Diff:0.850500 95CI:[ -1.442540,3.156494]
##
## Mean difference of C3 (n=100) minus C1 (n=100): C1 ≺ C3
## :p-val 0.0000
## Mean Diff:41.602257 95CI:[ 39.054019,44.030067]
##
## Mean difference of C4 (n=100) minus C1 (n=100): C1 ≺ C4
## :p-val 0.0000
## Mean Diff:60.851250 95CI:[ 58.566351,63.073160]
##
## Mean difference of C5 (n=100) minus C1 (n=100): C1 ≺ C5
## :p-val 0.0000
## Mean Diff:81.211195 95CI:[ 78.947049,83.515767]
##
## Mean difference of C3 (n=100) minus C2 (n=100): C2 ≺ C3
## :p-val 0.0000
## Mean Diff:40.751757 95CI:[ 38.394793,43.158967]
##
## Mean difference of C4 (n=100) minus C2 (n=100): C2 ≺ C4
## :p-val 0.0000
## Mean Diff:60.000749 95CI:[ 57.814919,62.180364]
##
## Mean difference of C5 (n=100) minus C2 (n=100): C2 ≺ C5
## :p-val 0.0000
## Mean Diff:80.360695 95CI:[ 78.139137,82.786273]
##
## Mean difference of C4 (n=100) minus C3 (n=100): C3 ≺ C4
## :p-val 0.0000
## Mean Diff:19.248992 95CI:[ 17.002332,21.357596]
##
## Mean difference of C5 (n=100) minus C3 (n=100): C3 ≺ C5
## :p-val 0.0000
## Mean Diff:39.608938 95CI:[ 37.354806,41.922535]
##
## Mean difference of C5 (n=100) minus C4 (n=100): C4 ≺ C5
## :p-val 0.0000
## Mean Diff:20.359945 95CI:[ 18.118550,22.577363]
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.500000
## Distribution: C2
## Mean:-204.649325 95CI:[ -778.513680,82.766177]
## Distribution: C4
## Mean:80.527799 95CI:[ 78.979312,82.026292]
## Distribution: C3
## Mean:82.958250 95CI:[ 81.586533,84.464490]
## Distribution: C1
## Mean:94.346655 95CI:[ 79.450525,121.609877]
## Distribution: C5
## Mean:205.612823 95CI:[ 136.953466,340.739501]
## =======================================================
## Mean difference of C4 (n=1200) minus C2 (n=1200): C2 ⊀ C4
## :p-val 0.7594
## Mean Diff:285.177124 95CI:[ -2.764830,859.586952]
##
## Mean difference of C3 (n=1200) minus C2 (n=1200): C2 ⊀ C3
## :p-val 0.0712
## Mean Diff:287.607575 95CI:[ -0.235241,861.508386]
##
## Mean difference of C1 (n=1200) minus C2 (n=1200): C2 ⊀ C1
## :p-val 0.6208
## Mean Diff:298.995980 95CI:[ -1.678617,911.544034]
##
## Mean difference of C5 (n=1200) minus C2 (n=1200): C2 ≺ C5
## :p-val 0.0000
## Mean Diff:410.262148 95CI:[ 55.574677,1051.577158]
##
## Mean difference of C3 (n=1200) minus C4 (n=1200): C4 ≺ C3
## :p-val 0.0132
## Mean Diff:2.430451 95CI:[ 0.388764,4.594564]
##
## Mean difference of C1 (n=1200) minus C4 (n=1200): C4 ⊀ C1
## :p-val 0.3571
## Mean Diff:13.818857 95CI:[ -1.233073,41.429367]
##
## Mean difference of C5 (n=1200) minus C4 (n=1200): C4 ≺ C5
## :p-val 0.0000
## Mean Diff:125.085024 95CI:[ 56.181719,260.435207]
##
## Mean difference of C1 (n=1200) minus C3 (n=1200): C3 ⊀ C1
## :p-val 0.9625
## Mean Diff:11.388406 95CI:[ -3.644848,49.771816]
##
## Mean difference of C5 (n=1200) minus C3 (n=1200): C3 ≺ C5
## :p-val 0.0000
## Mean Diff:122.654573 95CI:[ 54.113746,257.617282]
##
## Mean difference of C5 (n=1200) minus C1 (n=1200): C1 ≺ C5
## :p-val 0.0000
## Mean Diff:111.266168 95CI:[ 19.735246,258.317700]
## Time difference of 2.921255 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 1 row containing non-finite outside the scale range
## (`stat_density()`).