kfold,ubmsFit-method | R Documentation |
Randomly partition data into K subsets of equal size (by site). Re-fit the model
K times, each time leaving out one of the subsets. Calculate the log-likelihood
for each of the sites that was left out. This function is an alternative
to loo
(leave-one-out cross validation).
## S4 method for signature 'ubmsFit'
kfold(x, K = 10, folds = NULL, quiet = FALSE, ...)
x |
A |
K |
Number of folds into which the data will be partitioned |
folds |
An optional vector with length equal to the number of sites in the data and containing integers from 1 to K, to manually assign sites to folds. You should use this if you plan to compare multiple models, since the folds for each model should be identical. You can use |
quiet |
If |
... |
Currently ignored |
An object of class elpd_generic
that is compatible with loo::loo_compare
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.