
Leave-one-out pseudo-crossvalidation for graph_lme
models assuming observations at the vertices of metric graphs
Source: R/graph_inference.R
posterior_crossvalidation.Rd
This function performs pseudo-crossvalidation by computing leave-one-out predictions using the posterior distribution from a fitted model. In pseudo-crossvalidation, the model parameters are kept fixed at the values estimated from the full dataset (those provided in the object), rather than re-estimating them for each fold.
Usage
posterior_crossvalidation(
object,
factor = 1,
tibble = TRUE,
parallel = FALSE,
n_cores = parallel::detectCores() - 1,
print = FALSE
)
Arguments
- object
A fitted model using the
graph_lme()
function or a named list of fitted objects using thegraph_lme()
function.- factor
Which factor to multiply the scores. The default is 1.
- tibble
Return the scores as a
tidyr::tibble()
- parallel
Logical indicating whether to run computations in parallel. Default is FALSE.
- n_cores
Number of cores to use for parallel computation. Default is parallel::detectCores() - 1.
Logical indicating whether to print progress of which fold is being processed. Default is FALSE.