% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/deltaIC.R
\name{deltaIC}
\alias{deltaIC}
\title{Summarise DIC from \code{lgcp} estimates.}
\usage{
deltaIC(..., criterion = "DIC")
}
\arguments{
\item{\dots}{Comma-separated objects inheriting from class \code{inla} and
obtained from a run of \code{INLA::inla()}, \code{\link[=bru]{bru()}} or \code{\link[=lgcp]{lgcp()}}}

\item{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'}
}
\value{
A data frame with each row containing the Model name,
DIC and Delta.DIC.
}
\description{
Calculates DIC differences and produces an ordered summary.
}
\examples{
\donttest{
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)
}
}
}
