glmbayes: Bayesian Generalized Linear Models (IID Samples)

Provides Bayesian linear and generalized linear model fitting with independent and identically distributed (iid) posterior samples. The main functions mirror R's lm() and glm() interfaces while adding prior family specifications for Gaussian, Poisson, binomial, and Gamma models with log-concave likelihoods. Sampling for supported non-conjugate models uses accept-reject methods based on likelihood subgradients as in Nygren and Nygren (2006) <doi:10.1198/016214506000000357>. The package also includes tools for prior setup, posterior summaries, prediction, diagnostics, simulation, vignettes, and optional 'OpenCL' acceleration for larger models.

Getting started

Package overview README.md Chapter 00: Introduction Chapter 01: Getting started with glmbayes Chapter 02-S01: Conjugate Models — Introduction and Overview Chapter 02-S02: Normal–Normal Conjugacy for One Mean Chapter 02-S03: Beta–Binomial Conjugacy for One Proportion Chapter 02-S04: Gamma–Poisson Conjugacy for One Count Rate" Chapter 02-S05: Gamma–Gamma Conjugacy for One Response Rate Chapter 03: Estimating Bayesian linear models Chapter 04: Tailoring priors — leveraging the Prior_Setup function Chapter 05: Model predictions and posterior predictive checks (+ bayesplot ppc_*) Chapter 06: Deviance residuals, model statistics and posterior inference (+ bayestestR)" Chapter 07: Foundations of GLMs — families, links, and log-concave likelihoods Chapter 08: Estimating Bayesian generalized linear models Chapter 09: Models for the Binomial family Chapter 10: Models for the Poisson family Chapter 11: Models for the Gamma family Chapter 12: Visualizing posteriors with bayesplot Chapter 13: Bayesian inference and decision making with bayestestR Chapter 14: Informative priors — centering and differential prior weights" Chapter 15: Estimating models with unknown dispersion parameters Chapter 16: Large models — GPU acceleration using OpenCL" Chapter 17: Linear mixed-effects models" Chapter 18: Generalized linear mixed-effects models Chapter A01: A detailed overview of the glmbayes package Chapter A02: Overview of Estimation Procedures" Chapter A03: Methods available in glmbayes" Chapter A04: Directional Tail Diagnostics for Prior-Posterior Disagreement" Chapter A05: Simulation Methods - Likelihood Subgradient Densities" Chapter A06: Accept–Reject Sampling for Dispersion in Gamma Regression" Chapter A07: Accept–Reject Sampling for gaussian Regression models with independent normal-gamma priors Chapter A08: Overview of Envelope Related Functions" Chapter A09: Parallel Sampling Implementation using RcppParallel" Chapter A10: Accelerated EnvelopeBuild Implementation using OpenCL" Chapter A11: Implementation Companion for Independent Normal-Gamma Chapter A12: Technical Derivations for Priors Returned by `Prior_Setup()

Package details

AuthorKjell Nygren [aut, cre], The R Core Team [ctb, cph] (R Mathlib sources, R stats modeling code, and derived/adapted routines), The R Foundation [cph] (Portions of R Mathlib and R source code), Ross Ihaka [ctb, cph] (R Mathlib and original R modeling infrastructure), Robert Gentleman [ctb, cph] (Portions of R Mathlib), Simon Davies [ctb] (Original R glm implementation), Morten Welinder [ctb, cph] (Portions of R Mathlib), Martin Maechler [ctb] (Portions of R Mathlib)
MaintainerKjell Nygren <kjell.a.nygren@gmail.com>
LicenseGPL-2
Version0.9.75
URL https://CRAN.R-project.org/package=glmbayes  https://github.com/knygren/glmbayes  https://knygren.r-universe.dev/glmbayes 
Package repositoryView on CRAN
Installation Install the latest version of this package by entering the following in R:
install.packages("glmbayes")

Try the glmbayes package in your browser

Any scripts or data that you put into this service are public.

glmbayes documentation built on Aug. 5, 2026, 1:07 a.m.