ngvb: latent non-Gaussian models with R-INLA

ngvb takes an ordinary R-INLA latent Gaussian model (LGM), checks whether the latent Gaussian assumption is adequate, and extends it to a latent non-Gaussian model (LnGM), each in one line:

LGM <- inla(y ~ f(s, model = "rw1"), data = d, control.compute = list(config = TRUE))

ng.check(LGM)       # is the latent Gaussian assumption adequate, and where not?
LnGM <- ngvb(LGM)   # fit the non-Gaussian extension

Every worked example in the documentation needs INLA, which is not distributed on CRAN. The vignettes are therefore hosted on the package website rather than shipped with the package, so that they always build against a working INLA installation. They are listed below.

Vignettes

The full function reference is at https://rafaelcabral-ai.github.io/ngvb/reference/index.html.

Installing INLA

install.packages("INLA",
  repos = c(getOption("repos"), INLA = "https://inla.r-inla-download.org/R/stable"),
  dep = TRUE)

References

  • Cabral, R., Bolin, D. and Rue, H. (2024). Fitting latent non-Gaussian models using variational Bayes and Laplace approximations. Journal of the American Statistical Association 119(548):2983–2995. https://doi.org/10.1080/01621459.2023.2296704
  • Cabral, R., Bolin, D. and Rue, H. (2025). Robustness, model checking, and hierarchical models. Journal of the Royal Statistical Society Series B 87(3):632–652. https://doi.org/10.1093/jrsssb/qkae107