# NOT RUN {
# }
# NOT RUN {
## Simulate some allele frequencies:
freq <- replicate(10, { g = rgamma(n=10,scale=4,shape=3); g/sum(g)},
simplify=FALSE)
## Simulate a single database with 5000 DNA profiles:
simdb <- dbSimulate(freq,theta=0,n=5000)
## Simulate a number of databases, say N=50. For each database compute
## the summary statistic using dbCompare:
N <- 50
Msummary <- matrix(0,N,(length(freq)+1)*(length(freq)+2)/2)
for(i in 1:N)
Msummary[i,] <- dbCompare(dbSimulate(freq,theta=0,n=1000),
vector=TRUE,trace=FALSE)$m
## Give the columns representative names:
dimnames(Msummary)[[2]] <- DNAtools:::dbCats(length(freq),vector=TRUE)
## Plot the simulations using a boxplot
boxplot(log10(Msummary))
## There might come some warnings due to taking log10 to zero-values (no counts)
## Add the expected number to the plot:
points(1:ncol(Msummary),log10(dbExpect(freq,theta=0,n=1000,vector=TRUE)),
col=2,pch=16)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab