I have several GAM models fit with package mgcv
that share the same smooths and random effects groups. I would like to compare support for whether interactions between the fixed effects are supported using AIC.
My understanding is that we should use maximum likelihood rather than REML to compare between models differing only in their fixed effects. However, fitting the GAMs using ML instead of REML to my dataset takes much, much longer (more than a day versus tens of minutes).
I'd like to know if it is a sign of something wrong that changing the fitting method from REML to ML takes orders of magnitude longer. For reference my dataset has 19,395 entries. Here is the code for the most complex model. I only change method "REML"
to method = "ML"
.
level_bam7 <- bam(pa ~ scale(prev.rain) * level * roya_present +
scale(days.elapse) +
s(month, k=5, bs="cc") +
s(month, level, k=5, bs="fs") +
s(plantID, k=582, bs="re") +
s(quadrat, k=127, bs="re") + s(year, k=4, bs="re"),
family = binomial,
method = "REML", cluster = cl,
data = roya_1_long)