Open gavinsimpson opened 1 year ago
The main difficulty is that models fitted with glmmTMB()
do not store the smooths in object$smooth
, but rather buried much more deeply in object$modelInfo$reTrms$cond$smooth_info
. Much of {gratia} was written from the viewpoint of models objects that walked and quacked like a gam()
model fit even if they weren't quite one. Hence lots of trivial changes will be needed to accommodate glmmTMB()
models.
There are two main types of change required:
"glmmTMB"
methodBy default the methods that should be added in addition to the "glmmTMB"
will be
"gam"
(note that "bam"
inherits from "gam"
)"gamm"
"scam"
for models from the {scam} package"list"
(for {gamm4} fits until Simon fixes the bug in that incorrectly sets the class on the returned object - must test if object
is actually a gamm4()
fit using gratia::is.gamm4()
As mentioned in #227 {glmmTMB} now has basic support for penalised splines based on {mgcv}'s smooths and
smooth2random()
.What does {gratia} need to be able to support these models?
draw.glmmTMB()
smooth_estimates.glmmTMB()
appraise.glmmTMB()
(?)There are lots of utilities that will need methods for class
"glmmTMB"
, or be modified to work with these objects or be turned into S3 methods and methods wirtten for all classes currently handled by {gratia}smooths()
n_smooths()
get_smooths_by_id()
Work on this in the add-glmmTMB-support branch.