Prediction for a mixed effects regression model on a metric graph
# S3 method for graph_lme
predict(
object,
newdata = NULL,
mesh = FALSE,
mesh_h = 0.01,
which_repl = NULL,
compute_variances = FALSE,
compute_pred_variances = FALSE,
posterior_samples = FALSE,
pred_samples = FALSE,
n_samples = 100,
edge_number = "edge_number",
distance_on_edge = "distance_on_edge",
normalized = FALSE,
no_nugget = FALSE,
return_as_list = FALSE,
return_original_order = TRUE,
check_euclidean = TRUE,
...,
data = deprecated()
)
A list with elements mean
, which contains the means of the
predictions, fe_mean
, which is the prediction for the fixed effects, re_mean
, which is the prediction for the random effects, variance
(if compute_variance
is TRUE
), which contains the
posterior variances of the random effects, samples
(if posterior_samples
is TRUE
),
which contains the posterior samples.
The fitted object with the graph_lme()
function.
A data.frame
or a list
containing the covariates, the edge
number and the distance on edge for the locations to obtain the prediction. Observe that you should not provide the locations for each replicate. Only a single set of locations and covariates, and the predictions for the different replicates will be obtained for this same set of locations.
Obtain predictions for mesh nodes? The graph must have a mesh and should not have covariates.
If the graph does not have a mesh, one will be created with this value of 'h'.
Which replicates to obtain the prediction. If NULL
predictions
will be obtained for all replicates. Default is NULL
.
Set to TRUE to compute the kriging variances.
Set to TRUE to compute the prediction variances. Will only be computed if newdata is NULL
.
If TRUE
, posterior samples for the random effect will be returned.
If TRUE
, prediction samples for the response variable will be returned. Will only be computed if newdata is NULL
.
Number of samples to be returned. Will only be used if
sampling
is TRUE
.
Name of the variable that contains the edge number, the
default is edge_number
.
Name of the variable that contains the distance on
edge, the default is distance_on_edge
.
Are the distances on edges normalized?
Should the prediction be carried out without the nugget?
Should the means of the predictions and the posterior samples be returned as a list, with each replicate being an element?
Should the results be return in the original (input) order or in the order inside the graph?
Check if the graph used to compute the resistance distance has Euclidean edges? The graph used to compute the resistance distance has the observation locations as vertices.
Not used.