> require(DNAmixtures) > data(USCaucasian,SGMplusDyes) > USCaucasian2<-rbind(USCaucasian,data.frame(marker="D18S51",allele=9,frequency=0.001659950)) > ff<-c(paste(Sys.getenv('R_USER'),'/Research/Perturb/Sep2013',sep=''), + paste(Sys.getenv('R_USER'),'/Peter-Julia/mixtures/UAF',sep='')) > for(f in ff) if(file.exists(f)) {setwd(f); break} > #source('DNAmixtureUAF.R') > > data(SGMplusDyes) > > > evett.df <-read.csv("Evett1.txt", header=T, fill = TRUE, sep = "") > ##Starting up parameters > startpar <- mixpar( rho = list(6), eta= list(2000), xi = list(0.0001), + phi= list(c(suspect = 0.2, U1 = 0.8))) > > ######## Prosecution hypothesis: suspect and 1 unknown > > mix100P<-DNAmixture(list(evett.df), k=2, K = "suspect", C=list(100), database =USCaucasian2, dyes = list(SGMplusDyes)) > > > par(mfrow = c(3, 2)) > plot(mix100P, threshold = TRUE) > > ml100P <- mixML(mix100P, startpar, trace = F) > ###NB below old computation not using Evett's allele freq.## > ml100P$lik/log(10) [1] -84.02039 > > > ml100P$mle rho eta xi phi.U1 phi.suspect 1 5.162 2482 0.000000000000001114 0.1369 0.8631 > > > #\mu= rho*eta > ml100P$mle[[1]]*ml100P$mle[[2]] [1] 12809.82 > > > # Coefficient of variation \sigma > 1/sqrt(ml100P$mle[[1]]) [1] 0.4401428 > > #mixture proportion for H_P: donor 1 and 1 unknown U1 > ml100P$mle[[4]] U1 suspect 0.1368907 0.8631093 > > ######## Defence hypothesis: 2 unknown > > mix100D<-DNAmixture(list(evett.df), k=2, K = character(0), C=list(100), database = USCaucasian2, dyes = list(SGMplusDyes)) > > startpar <- mixpar( rho = list(6), eta= list(2000), xi = list(0.0001), + phi= list(c(U2 = 0.2, U1 = 0.8))) > > ml100D <- mixML(mix100D, startpar, trace = F) > > ml100D$lik/log(10) [1] -92.48052 > > > ml100D$mle rho eta xi phi.U1 phi.U2 1 5.006 2559 0.000000000038 0.8603 0.1397 > > > #\mu= rho*eta > ml100D$mle[[1]]*ml100D$mle[[2]] [1] 12809.25 > > > # Coefficient of variation \sigma > 1/sqrt(ml100D$mle[[1]]) [1] 0.4469324 > > > #mixture proportion for H_P: donor 1 and 1 unknown U1 > ml100D$mle[[4]] U1 U2 0.8602849 0.1397151 > > > ###########Likelihood ratios log10(LR)####### > > ###WoE for H_p: suspect & U1 vs H_d: U1 &U2### > > ml100P$lik/log(10) - ml100D$lik/log(10) [1] 8.460134 > > > ###COMPARISON with Evett and Cowell et al. 2006:### > ### Using same allele frequencies### > #DNA mixtures 8.50 whereas Evett gave 7.3 and Cowell et al 8.23 > > #>DNA mixtures 8.83 (but different allele frequencies) whereas Evett gave 7.3 and Cowell et al 8.23 >