Returns the linear predictor or inverse-link response at each observation
in the training data, or at user-supplied newdata. For mixed-family fits,
type = "response" uses the row's own trait/family inverse link rather
than the first trait's link.
Arguments
- object
A fit returned by
gllvmTMB().- newdata
Optional new data frame. If
NULL, predictions are produced for the training rows.- type
One of
"link"(default) or"response"."response"includes the row's offset, so on a fit with an effort or support offset it returns an expected count at that effort, or a detection probability at that support – not a relative intensity. For a map or any effort-free comparison, set the offset variable to zero innewdata(e.g.newdata$log_support <- 0) and predict from that; the offset is re-evaluated againstnewdata, so this is exact rather than an approximation.On a mixed-family fit the returned
estcolumn mixes scales by design (expected counts beside probabilities). The fit's family/source column is returned alongside it so each row's scale is identifiable.- re_form
Random-effect formula controlling which random effects are included in the predicted linear predictor. The default
~ .includes them;~ 0,NA, and numeric0all request the fixed-effects-only / population-mean prediction. Any other value is not a supported form and warns rather than silently including the random effects. Honoured on both the training-row and thenewdatapath (before 0.7.1 it was read only on thenewdatapath, and there only as the literal~ 0). Fornewdatawith sites/species not present in the training data the random effects cannot be drawn, so those rows are fixed-effects-only regardless ofre_form.On
newdata,predict()rebuilds the linear predictor in R and can re-add only some of the model's random-effect tiers (the unit-levelrr/diagterms,propto, and the spatial SPDE field). Structured intercepts also include their shared and folded Psi effects at known source levels; ancestral prediction is not added. A fit carrying any other active tier gets a warning naming exactly what was omitted;newdata = NULLalways returns the full conditional predictor.- se.fit
Logical, default
FALSE. IfTRUE, add anse.fitcolumn: a conditional, fixed-effect-only, delta-method (Wald) standard error ofest. "Conditional" means the random-effect contributions to the linear predictor are held fixed at their predicted (conditional-mode) values – their own uncertainty is not propagated, only the fixed-effect coefficients'sdreport()covariance is. This is a smaller quantity than a full marginal SE would be; it is also not a claim about coverage, which has not been measured for this quantity.type = "link"returns the SE of the linear predictor directly;type = "response"multiplies it by the local derivative of the per-row inverse link (the standard delta-method transform), so it approximates the SE of the inverse-link fitted value, not an exact one. Currently only supported fornewdata = NULL(training rows), non-multinomial()fits, fits without an activemi()missing-covariate model, and fits with unit likelihood weights. A non-unit weighted objective has no certified prediction-standard-error route.- ...
Unused.
