Evaluate or sample from a posterior result given a model and locations
evaluate_model(
model,
state,
data = NULL,
A = NULL,
predictor = NULL,
format = NULL,
include = NULL,
exclude = NULL,
...
)evaluate_state(
model,
result,
property = "mode",
n = 1,
seed = 0L,
num.threads = NULL,
internal_hyperpar = FALSE,
...
)
A bru model
list of lists, as generated by evaluate_state()
A list
, data.frame
, or Spatial*DataFrame
, with coordinates
and covariates needed to evaluate the predictor.
Precomputed A-matrices
A formula or an expression to be evaluated given the
posterior or for each sample thereof. The default (NULL
) returns a
data.frame
containing the sampled effects. In case of a formula the right
hand side is used for evaluation.
character; determines the storage format of predictor output. Available options:
"auto"
If the first evaluated result is a vector or single-column matrix,
the "matrix" format is used, otherwise "list".
"matrix"
A matrix where each column contains the evaluated predictor
expression for a state.
"list"
A list where each element contains the evaluated predictor
expression for a state.
Character vector of component labels that are needed by the predictor expression; Default: NULL (include all components that are not explicitly excluded)
Character vector of component labels that are not used by the
predictor expression. The exclusion list is applied to the list
as determined by the include
parameter; Default: NULL (do not remove
any components from the inclusion list)
Additional arguments passed on to inla.posterior.sample
Property of the model components to obtain value from.
Default: "mode". Other options are "mean", "0.025quant", "0.975quant",
"sd" and "sample". In case of "sample" you will obtain samples from the
posterior (see n
parameter). If result
is NULL
, all-zero vectors are
returned for each component.
Number of samples to draw.
If seed != 0L, the random seed
Specification of desired number of threads for parallel computations. Default NULL, leaves it up to INLA. When seed != 0, overridden to "1:1"
logical; If TRUE
, return hyperparameter properties
on the internal scale. Currently ignored when property="sample"
.
Default is FALSE
.
evaluate_model
is a wrapper to evaluate model state, A-matrices,
effects, and predictor, all in one call.
evaluate_state
evaluates model state properties or samples