Description Usage Arguments Value
Given a fitted inla
object for a spatial
geostatistical model, make predictions to a new dataset
or RasterBrick
either from the maximum a posterior parameter
set, or as samples from the predictive posterior.
Note that this function is only designed to work with a specific type of geostatistical model, fitted in a specific way and is likely to produce unexpected (i.e. wrong) results when used with other types of model.
Examples of things that aren't allowed are:
prediction using factor (discrete) variables.
Though it should be possible to manually expand the factors into the
correctly named dummy variables (see inla$names.fixed
for the
expected names) and predict to these. This includes the use of iid
random effects, unfortunately.
prediction using models constructed with anything other than an spde2 spatial model.
spatial models fitted using 3D Cartesian coordinates (to be added soon).
space-time models (to be added soon).
1 2 3 4 5 |
inla |
a fitted |
data |
a dataframe giving all of the covariates for the fixed effects part of the model and the temporal term is applicable. |
mesh |
the |
coords |
a character vector of length two giving the names of the
columns in |
type |
the type of prediction required. The default is on the scale of
the linear predictors; the alternative |
method |
whether to draw |
n |
if |
fixed |
whether to include fixed effects terms in the predictor |
spatial |
whether to include spatial terms in the predictor |
fixed_subset |
an optional character vector giving a subset of covariates to include in the fixed effects prediction. |
ncpu |
the number of cores to use to make predictions. If
|
raster |
a |
constants |
an optional named list giving constant values for named
fixed effects in |
... |
arguments to be passed to |
predictINLA: a matrix with the same number of rows as data
giving the
predicted values at these locations
predictRasterINLA: a RasterBrick
or RasterStack
(if method = 'sample'
) or RasterLayer
(if
method = 'MAP'
) giving pixel-level predictions from inla
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.