allFit {lme4} | R Documentation |
Attempt to re-fit a [g]lmer model with a range of optimizers. The default is to use all known optimizers for R that satisfy the requirements (do not require explicit gradients, allow box constraints), in three categories; (i) built-in (minqa::bobyqa, lme4::Nelder_Mead, nlminbwrap), (ii) wrapped via optimx (most of optimx's optimizers that allow box constraints require an explicit gradient function to be specified; the two provided here are really base R functions that can be accessed via optimx, (iii) wrapped via nloptr; (iv)
allFit(m, meth.tab = NULL, data=NULL, verbose = TRUE, show.meth.tab = FALSE, maxfun = 1e5, parallel = c("no", "multicore", "snow"), ncpus = getOption("allFit.ncpus", 1L), cl = NULL)
m |
a fitted model |
meth.tab |
a matrix (or data.frame) with columns
|
data |
data to be included with result (for later debugging etc.) |
verbose |
logical: report progress in detail? |
show.meth.tab |
logical: return table of methods? |
maxfun |
passed as part of |
parallel |
The type of parallel operation to be used (if any).
If missing, the
default is taken from the option |
ncpus |
integer: number of processes to be used in parallel operation: typically one would choose this to be the number of available CPUs. |
cl |
An optional parallel or snow cluster for use if
|
a list of fitted merMod
objects (unless show.meth.tab
is
specified, in which case a data frame of methods is returned)
If you are using parallel="snow"
, you will need to run
clusterEvalQ(cl,library("lme4"))
before calling
allFit
to make sure that the
lme4
package is loaded on all of the workers
slice
,slice2D
from the bbmle
package
library(lme4) gm1 <- glmer(cbind(incidence, size - incidence) ~ period + (1 | herd), data = cbpp, family = binomial) ## show available methods allFit(show.meth.tab=TRUE) gm_all <- allFit(gm1) ss <- summary(gm_all) ss$fixef ## extract fixed effects ss$llik ## log-likelihoods ss$sdcor ## SDs and correlations ss$theta ## Cholesky factors ss$which.OK ## which fits worked