Rationale

The inlatools package provides a set of function which can be useful to diagnose INLA models.

  • calculate Pearson residuals
  • simulation based checks for over- or underdispersion
  • simulation based checks for the distribution
  • visualise the effect of the variance or precision on random effects
    • random intercept
    • first order random walk
    • second order random walk

Installation

ip <- rownames(installed.packages())
if (!"remotes" %in% ip) {
  install.packages("remotes")
}
if (!"INLA" %in% ip) {
  install.packages(
    "INLA", 
    repos = c(getOption("repos"), "https://inla.r-inla-download.org/R/stable")
  )
}
remotes::install_github("inbo/inlatools")

Documentation

All documentation is available at the package website: https://inlatools.netlify.com. This website contains an overview of all available functions. Click on the name the function to open the corresponding help file. The vignettes illustrate how to check the dispersion, how to check the distribution and how to visualise random effects for a given variance or precision.

Folder structure

  • R: The source scripts of the R functions with documentation in Roxygen format
  • man: The helpfile in Rd format
  • test: unit tests using the testthat framework
  • vignettes: the source code of the vignettes
inlatools
├── man
├── R
├─┬ tests
│ └── testthat
└── vignettes