Learn R Programming

MetricGraph (version 1.6.0)

posterior_crossvalidation_loo: Leave-one-out pseudo-crossvalidation for graph_lme models assuming observations at the vertices of metric graphs

Description

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_loo(
  object,
  factor = 1,
  tibble = TRUE,
  which_repl = NULL
)

Value

Vector with the posterior expectations and variances as well as mean absolute error (MAE), root mean squared errors (RMSE), and three negatively oriented proper scoring rules: log-score, CRPS, and scaled CRPS.

Arguments

object

A fitted model using the graph_lme() function or a named list of fitted objects using the graph_lme() function.

factor

Which factor to multiply the scores. The default is 1.

tibble

Return the scores as a tidyr::tibble()

which_repl

Which replicates to consider?