loo_cv | R Documentation |
loo::loo()
.Approximate leave-one-out cross-validation (LOO) using loo::loo()
.
loo_cv(input, object, censoring = TRUE, ...)
input |
The dataframe of observations used to generate the model. |
object |
A |
censoring |
Logical. Is the response left-censored? |
... |
Arguments passed on to |
An object of class loo
.
library("brms")
seed <- 1
data <- read.csv(paste0(system.file("extdata", package = "bgamcar1"), "/data.csv"))
fit <- fit_stan_model(
paste0(system.file("extdata", package = "bgamcar1"), "/test"),
seed,
bf(y | cens(ycens, y2 = y2) ~ 1),
data,
prior(normal(0, 1), class = Intercept),
car1 = FALSE,
save_warmup = FALSE,
chains = 3
)
loo_cv(data, fit, draw_ids = 1:3000, car1 = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.