Troubleshooting Banta fits

I noticed when re-fitting the Banta fruit data (which I hadn't previously looked at) that we were now getting some convergence warnings when fitting the full data

dat.tf <- read.csv("../data/Banta_TotalFruits.csv")
library(lme4)
mp1 <- glmer(total.fruits ~ nutrient*amd +
             rack + status +
             (amd*nutrient|popu)+
             (amd*nutrient|gen),
             data=dat.tf, family="poisson")

try restarting from the same point

final <- getME(mp1,c("theta","fixef"))  ## extract theta and beta (fixed)
sapply(final,length)  ## lots of parameters!
mp1U <- update(mp1,start=final)
summary(fixef(mp1U)/fixef(mp1))
thratio <- getME(mp1U,"theta")/getME(mp1,"theta")
summary(thratio)
## one theta value changed quite a bit!
## first few values ...
head(sort(thratio))
cbind(getME(mp1U,"theta")[thratio<0.9],
      getME(mp1,"theta")[thratio<0.9])
## these are all very small-magnitude values ...      
logLik(mp1U)-logLik(mp1)  ## log-likelihood hardly changed
scgrad <- function(x) {
    drv <- x@optinfo$derivs
    solve(drv$Hessian,drv$gradient)
}
range(abs(scgrad(mp1)))
range(abs(scgrad(mp1U)))

try other optimizers

source("../R/allFit.R")
aa <- allFit(mp1)
summary.allfit(aa)

try looking at likelihood slices

dd1 <- update(mp1,devFunOnly=TRUE)
pp1 <- unlist(getME(mp1,c("theta","fixef")))
s2D.1 <- bbmle:::slice2D(pp1,dd1)
splom(s2D.1)


lme4/lme4 documentation built on April 24, 2024, 5:51 p.m.