Learn R Programming

inlabru (version 2.3.1)

deltaIC: Summarise DIC and WAIC from lgcp objects.

Description

Calculates DIC and WAIC differences and produces an ordered summary.

Usage

deltaIC(..., criterion = "DIC")

Arguments

...

Comma-separated objects inheriting from class inla and obtained from a run of INLA::inla(), bru() or lgcp()

criterion

If 'DIC', plots DIC differences; If 'WAIC', plots WAIC differences.

Value

A data frame with each row containing the model name, DIC, WAIC, deltaDIC, and deltaWAIC.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# Generate some data
input.df <- data.frame(x = cos(1:10))
input.df <- within(
  input.df,
  y <- ceiling(5 + 2 * cos(1:10) + rnorm(10, mean = 0, sd = 0.1))
)

# Fit two models
fit <- bru(y ~ x, family = "gaussian", data = input.df)
fit2 <- bru(y ~ x, family = "Poisson", data = input.df)

# Compare DIC

deltaIC(fit, fit2)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab