Prediction of the linear predictor at newdata, on the link or response
scale. The fixed-effect part is X beta with credible bounds from the
fixed-effect covariance (vcov()). For a fit carrying a continuous spatial
field, the posterior-mean field is interpolated (kriged) to the newdata
coordinates and added to the linear predictor by default, so predict()
gives the conditional (location-specific) prediction. Three continuous field
families are supported: an SPDE Matern field (spatial_spde()), projected
through the mesh; a Hilbert-space GP field (spatial_gp(approx = "hsgp")),
where the Laplacian basis is re-evaluated at the new coordinates (with the
training centring / boundary); and a GP / NNGP field (spatial_gp()),
interpolated by the NNGP conditional mean at each new location's nearest
training locations. The HSGP and GP/NNGP fields are marginalised over the
hyperparameter grid (not plugged in at the posterior mean). Ordinary random
effects are held at zero (population level); add group effects from ranef()
when needed. An areal (ICAR / BYM2 / CAR) or temporal (RW1 / RW2 / AR1) field
is held at zero in the same way, at the training design too; the in-sample
linear predictor with every fitted component is what posterior_predict()
draws and what compare_models(criterion = "waic") / "loo" score.
Arguments
- object
A
tulpa_fitobject.- newdata
Data frame of covariates (and, for an SPDE fit, the coordinate columns named in the spec's coordinate formula). If
NULL, predicts at the training design (requires$model_matrix).- type
"link"(linear predictor) or"response"(mean scale,E[y]). For a binomial fit the"response"scale here is the per-trial success probabilityg^{-1}(eta)(there is non_trialsatnewdata); this differs fromfitted(), which returns the trial-scaled expected count at the training design. On a zero-inflated fit (ziformula) the"link"scale is the count predictor and the"response"scale is the mixture mean(1 - pi) E[y | eta],pi = plogis(X_zi beta_zi), with the zero-inflation design rebuilt from the fit'sziformulaatnewdata.- se.fit
If
TRUE, also return the link-scale standard error and credible bounds. With an included SPDE field the SE propagates the joint (fixed-effect, field) posterior precision at the fitted hyperparameters – including the cross term – conditional on(range, sigma)(a nested fit's hyperparameter-grid spread is not propagated, so the bound is mildly optimistic when that posterior is wide). Integer-nu, no-RE SPDE fits only; other layouts decline with an explanation. On a zero-inflated fitse.fitis the count predictor's, and the response-scale bounds are quantiles of the mixture mean over draws of the count and zero-inflation coefficients jointly (pinned, so repeated calls agree).- level
Credible-interval level (default 0.95).
- include_field
For a continuous-spatial fit (SPDE, HSGP, or GP/NNGP), add the kriged field to the prediction (default
TRUE).FALSEgives the fixed-effect (population) prediction. Ignored for fits with no continuous field. For an HSGP or GP/NNGP fit the field is added to the point prediction but its uncertainty is not yet propagated intose.fit(the interval reflects the fixed-effect covariance only).- ...
Ignored.