Compute prediction of a formula-based expression on a testing set based on a training set.
group_predict(
models,
model_names = NULL,
formula = NULL,
train_indices,
test_indices,
n_samples = 1000,
pseudo_predict = TRUE,
return_samples = FALSE,
return_hyper_samples = FALSE,
n_hyper_samples = 1,
compute_posterior_means = TRUE,
print = TRUE,
fit_verbose = FALSE
)
A data.frame with the fitted models and the corresponding scores.
A fitted model obtained from calling the bru()
function or a list of models fitted with the bru()
function.
A vector containing the names of the models to appear in the returned data.frame
. If NULL
, the names will be of the form Model 1
, Model 2
, and so on. By default, it will try to obtain the name from the models list.
A formula where the right hand side defines an R expression to evaluate for each generated sample. If NULL``, the latent and hyperparameter states are returned as named list elements. See the manual for the
predictmethod in the
inlabru` package.
A list containing the indices of the observations for the model to be trained, or a numerical vector containing the indices.
A list containing the indices of the test data, where the prediction will be done, or a numerical vector containing the indices.
Number of samples to compute the posterior statistics to be used to compute the scores.
If TRUE
, the models will NOT be refitted on the training data, and the parameters obtained on the entire dataset will be used. If FALSE
, the models will be refitted on the training data.
Should the posterior samples be returned?
Should samples for the hyperparameters be obtained?
Number of independent samples of the hyper parameters of size n_samples
.
Should the posterior means be computed from the posterior samples?
Should partial results be printed throughout the computation?
Should INLA's run during the prediction be verbose?