ABC performance under different settings

The ABC process was run for 400x2, 800x2, 1600x2, 2400x2 individuals. In the “low” setting, prob of acceptance is 0.2. In the “high” setting, 0.1. *** the run at 2000x2 individuals in low settings is not completed***

1. Running time

time.hi<-read.csv('/Users/feimeng/Dropbox/Papers_FeiMeng/NetStructSim/code/SimpactPresentNSimulation/Lenormand_high_time.csv')
time.low<-read.csv('/Users/feimeng/Dropbox/Papers_FeiMeng/NetStructSim/code/SimpactPresentNSimulation/Lenormand_low_time.csv')
plot(log(time.hi[,3]/60)~time.hi[,2],main='Running Time',xlab='Initial population (one gender)',ylab='Minutes (log e)',type='l')
lines(log(time.low[,3]/60)~time.low[,2],col='red')

plot of chunk unnamed-chunk-1 2. Results Results from the “low” setting:

# Compare ABC performance
library(foreign)
library(e1071)
names<-c('dis.0','dis.num.diff','form.num.man','form.num.woman','form.num.dif','form.baseline','form.eager.dif','degree.mix','shorterm','degut')
perform.low<-list()

for(i in 1:10) perform.low[[i]]<-rep(0,10)
for (size in c(200,400,800,1200,2000)){
  name<-sprintf('/Users/feimeng/Dropbox/Papers_FeiMeng/NetStructSim/code/SimpactPresentNSimulation/Lenormand_low_%d.csv',size)
  dat<-read.csv(name)
  par(mfcol=c(ceiling(ncol(dat)/3),3),mar = rep(2, 4))
  for(i in 2:(ncol(dat)-1)) {
    values<-dat[,i]
    hist(dat[,i],main=names[i-1])
    this.perform.low<-c(summary(values),kurtosis(values,type=1),kurtosis(values,type=2),kurtosis(values,type=3),skewness(values))
    perform.low[[i-1]]<-rbind(perform.low[[i-1]],this.perform.low)
  }
}

plot of chunk unnamed-chunk-2 plot of chunk unnamed-chunk-2 plot of chunk unnamed-chunk-2 plot of chunk unnamed-chunk-2 plot of chunk unnamed-chunk-2 Results from the “high” setting:

perform.hi<-list()
for(i in 1:10) perform.hi[[i]]<-rep(0,10)
for (size in c(200,400,800,1200,2000)){
  name<-sprintf('/Users/feimeng/Dropbox/Papers_FeiMeng/NetStructSim/code/SimpactPresentNSimulation/Lenormand_high_%d.csv',size)
  dat<-read.csv(name)
  par(mfcol=c(ceiling(ncol(dat)/3),3),mar = rep(2, 4))
  for(i in 2:(ncol(dat)-1)) {
    values<-dat[,i]
    hist(dat[,i],main=names[i-1])
    this.perform.hi<-c(summary(values),kurtosis(values,type=1),kurtosis(values,type=2),kurtosis(values,type=3),skewness(values))
    perform.hi[[i-1]]<-rbind(perform.hi[[i-1]],this.perform.hi)
  }
}

plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 plot of chunk unnamed-chunk-3 3. Targets Summary of the output (target) variable:

sizes<-c(0,200,400,800,1200,2000)
for (i in 8:10){
  par(mfrow=c(3,2))
  mean.hi<-perform.hi[[i]][,4]
  Q.hi<-perform.hi[[i]][,5]-perform.hi[[i]][,2]
  kurtosis.1.hi<-perform.hi[[i]][,7]
  kurtosis.2.hi<-perform.hi[[i]][,8]
  kurtosis.3.hi<-perform.hi[[i]][,9]
  mean.low<-perform.low[[i]][,4]
  Q.low<-perform.low[[i]][,5]-perform.low[[i]][,2]
  kurtosis.1.low<-perform.low[[i]][,7]
  kurtosis.2.low<-perform.low[[i]][,8]
  kurtosis.3.low<-perform.low[[i]][,9]
  plot(mean.hi~sizes,type='l',ylim=c(min(mean.hi,mean.low),max(mean.hi,mean.low)),main='mean',ylab=names[i])
  lines(mean.low~sizes,col='red')
  plot(Q.hi~sizes,type='l',ylim=c(min(Q.hi,Q.low),max(Q.hi,Q.low)),main="Q",ylab=names[i])
  lines(Q.low~sizes,col='red')
  plot(kurtosis.1.hi~sizes,type='l',ylim=c(min(kurtosis.1.hi,kurtosis.1.low),max(kurtosis.1.hi,kurtosis.1.low)),main="kurtosis.1",ylab=names[i])
  lines(kurtosis.1.low~sizes,col='red')
  plot(kurtosis.2.hi~sizes,type='l',ylim=c(min(kurtosis.2.hi,kurtosis.2.low),max(kurtosis.2.hi,kurtosis.2.low)),main="kurtosis.2",ylab=names[i])
  lines(kurtosis.2.low~sizes,col='red')
  plot(kurtosis.3.hi~sizes,type='l',ylim=c(min(kurtosis.3.hi,kurtosis.3.low),max(kurtosis.3.hi,kurtosis.3.low)),main="kurtosis.3",ylab=names[i])
  lines(kurtosis.3.low~sizes,col='red')
}

plot of chunk unnamed-chunk-4 plot of chunk unnamed-chunk-4 plot of chunk unnamed-chunk-4 4. Test the Correlation between Parameters

par(mfrow=c(6,6),mar = rep(1, 4))
for(i in 2:7){
  for(j in 2:7){
    plot(dat[,i],dat[,j])
  }
}

plot of chunk unnamed-chunk-5

5. Summary

(1) No significant difference between low&high settings

(2) No very obvious difference between different population sizes

~~1200x2 might be a good choice

(3) Correlations between the parameters

names[c(2,3,6,7)]
## [1] "dis.num.diff"   "form.num.man"   "form.baseline"  "form.eager.dif"