estfun.glmmTMB: Extract Empirical Estimating Functions

estfun.glmmTMBR Documentation

Extract Empirical Estimating Functions

Description

This method for estfun extracts the clusterwise score vectors (empirical estimating functions) from a fitted glmmTMB model.

Usage

## S3 method for class 'glmmTMB'
estfun(x, full = FALSE, cluster = getGroups(x), rawnames = FALSE, ...)

Arguments

x

a glmmTMB object fitted with ML (REML is not supported).

full

logical; if TRUE, return the full score vectors including random effects, otherwise only the fixed effects part.

cluster

a factor indicating the cluster structure of the data.

rawnames

logical; if TRUE, return the raw names of the parameters as in the TMB object. By default, FALSE such that the names are sanitized to user friendly names.

...

additional arguments (ignored).

Value

A matrix where each row corresponds to a cluster and each column corresponds to a parameter in the model. The values are the empirical estimating functions (score vectors) for each parameter in each cluster.

Note

If crossed random effects are used in the model, this function will not correctly calculate the score vectors in general, and warnings will be issued. In general, this function should be used with models with a single level of random effects or nested random effects only.

Examples

m <- glmmTMB(count ~ mined + (1 | spp), data = Salamanders, family = nbinom1)
estfun(m)
estfun(m, full = TRUE)

glmmTMB documentation built on Jan. 15, 2026, 9:07 a.m.