Skip to content

Commit

Permalink
plot to make AIC histograms
Browse files Browse the repository at this point in the history
  • Loading branch information
ottiP committed Jan 19, 2022
1 parent 128ab25 commit 311459b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions create_figures_ms/AIC_computation.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
compute_AIC <- function(ll,p){

AIC <- 2*p+2*ll
return(AIC)

}

result1<- readRDS("../Results/result100_Jul_nointerA.rds")
min_ll1 <- sapply(result1,'[[','minimum')
parms1 <- sapply(result1,'[[','estimate')
p1 <- nrow(parms1)
AIC1 <- compute_AIC(min_ll1,p1)

result2<- readRDS("../Results/result100_Jul_allinter_TestA.rds")
min_ll2 <- sapply(result2,'[[','minimum')
parms2 <- sapply(result2,'[[','estimate')
p2 <- nrow(parms2)
AIC2 <- compute_AIC(min_ll2,p2)




pdf("hist_12.pdf")
hist(AIC1-AIC2, col="gray", xlab="AIC difference",ylab="",main=paste("AIC difference between model 1 and model 2"))
dev.off()

pdf("hist_13.pdf")
hist(AIC2-AIC3, col="gray", xlab="AIC difference",ylab="",main=paste("AIC difference between model 2 and model 3"))
dev.off()

0 comments on commit 311459b

Please sign in to comment.