| deltaIC | R Documentation |
lgcp estimates.Calculates DIC differences and produces an ordered summary.
deltaIC(..., criterion = "DIC")
... |
Comma-separated objects inheriting from class |
criterion |
character vector. If it includes 'DIC', computes DIC differences; 'WAIC' is also allowed, but note that plain WAIC values from inla are not well-defined for point process models. Default 'WAIC' |
A data frame with each row containing the Model name, DIC and Delta.DIC.
if (bru_safe_inla()) {
# Generate some data
input.df <- data.frame(idx = 1:10) |>
dplyr::mutate(
x = cos(idx),
y = rpois(length(x), 5 + 2 * x + rnorm(length(x), mean = 0, sd = 0.1))
)
# Fit two models
fit1 <- bru(
y ~ x,
family = "poisson",
data = input.df,
options = list(control.compute = list(dic = TRUE))
)
fit2 <- bru(
y ~ x + rand(idx, model = "iid"),
family = "poisson",
data = input.df,
options = list(control.compute = list(dic = TRUE))
)
# Compare DIC
deltaIC(fit1, fit2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.