Bayesian Generalized Linear Models (IID Samples)
Overview
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.
Bug fixes
- **Configure (Linux/macOS):**
-DUSE_OPENCLis set only when a **non-PoCL** OpenCL platform exposes at least one **GPU** device. PoCL-only ICD stacks (typical on CRAN **debian-gcc** incoming) no longer enable OpenCL at compile time, sohas_opencl()isFALSEduring check and kernel builds do not touch~/.cache/pocl(addresses incoming NOTE ontempfile_*there). Real GPU installs (NVIDIA/AMD/Intel) are unchanged. - **Vignette Chapter 16:**
diagnose_glmbayes(),opencltools::diagnose_glmbayes(), andexample(Cleveland)chunks areeval=FALSEduring vignette rebuild (defense in depth alongside configure).
From NEWS.md in the release
Install
Health
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK6 OK2026-05-05
Documentation
- Help pages
- 58 (1 internal)includes a package overview page
- Examples that run
- 100%50 run in a plain check (1 of them under a condition)
- Exported functions with examples
- 84%
- Documented parameters
- 97%
- Return-value docs
- 94%
- Help pages citing references
- 62% with a bibliography file
Also includes 15 demo scripts (run with demo())
- Chapter 00: Introduction
- Chapter 01: Getting started with glmbayes
- Chapter 02-S01: Conjugate Models — Introduction and Overview HTML
- Chapter 02-S02: Normal–Normal Conjugacy for One Mean HTML
- Chapter 02-S03: Beta–Binomial Conjugacy for One Proportion HTML
- Chapter 02-S04: Gamma–Poisson Conjugacy for One Count Rate HTML
- Chapter 02-S05: Gamma–Gamma Conjugacy for One Response Rate HTML
- Chapter 03: Estimating Bayesian linear models HTML
- Chapter 04: Tailoring priors — leveraging the Prior_Setup function
- Chapter 05: Model predictions and posterior predictive checks (+ bayesplot ppc_*) HTML
Show 25 moreHide 25 vignettes
- Chapter 06: Deviance residuals, model statistics and posterior inference (+ bayestestR) HTML
- Chapter 07: Foundations of GLMs — families, links, and log-concave likelihoods HTML
- Chapter 08: Estimating Bayesian generalized linear models HTML
- Chapter 09: Models for the Binomial family HTML
- Chapter 10: Models for the Poisson family HTML
- Chapter 11: Models for the Gamma family HTML
- Chapter 12: Visualizing posteriors with bayesplot HTML
- Chapter 13: Bayesian inference and decision making with bayestestR HTML
- Chapter 14: Informative priors — centering and differential prior weights HTML
- Chapter 15: Estimating models with unknown dispersion parameters HTML
- Chapter 16: Large models — GPU acceleration using OpenCL HTML
- Chapter 17: Linear mixed-effects models HTML
- Chapter 18: Generalized linear mixed-effects models HTML
- Chapter A01: A detailed overview of the glmbayes package HTML
- Chapter A02: Overview of Estimation Procedures HTML
- Chapter A03: Methods available in glmbayes HTML
- Chapter A04: Directional Tail Diagnostics for Prior-Posterior Disagreement HTML
- Chapter A05: Simulation Methods - Likelihood Subgradient Densities HTML
- Chapter A06: Accept–Reject Sampling for Dispersion in Gamma Regression HTML
- Chapter A07: Accept–Reject Sampling for gaussian Regression models with independent normal-gamma priors HTML
- Chapter A08: Overview of Envelope Related Functions HTML
- Chapter A09: Parallel Sampling Implementation using RcppParallel HTML
- Chapter A10: Accelerated EnvelopeBuild Implementation using OpenCL HTML
- Chapter A11: Implementation Companion for Independent Normal-Gamma HTML
- Chapter A12: Technical Derivations for Priors Returned by `Prior_Setup() HTML
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 1,999
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
Forks over time
Releases over time
Issues over time
Commits over time
5 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/knygren/glmbayes on 2026-10-21.
The R CMD check workflow runs on Linux
This repository shows signs of AI coding tools.
- Cursorfirst seen 2026-04-18Seen in the repository: .cursorNamed in .Rbuildignore: .cursorCommits: at least 2 crediting it in the message
- Claude Codefirst seen 2026-04-24Named in .Rbuildignore: .claude
Dependencies
Installing glmbayes adds 12 packages (7 with compiled code, 12 MB of source tarballs). Heaviest: nmathopencl 2.2 MB, Rcpp 1.8 MB, opencltools 1.6 MB.
CRAN will archive these unless their check problems are fixed by the date shown. This package needs each one to install.
- insightfix by Nov 14
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- unarchivedReturned to CRAN2026-08-04
- 0.9.75Latest
- archivedRemoved from CRAN2026-07-31policy violation Recommends packages from GitHub
- 0.9.722026-07-26 · diff ↗
- 0.9.72026-07-19 · diff ↗ ·
removed 2 exports
load_kernel_library, load_kernel_sourceadded 15 exports
check_prior, describe_prior, find_algorithm, find_parameters, get_data, get_parameters, get_priors, model_info, rBeta_prior, rGamma_Conjugate_prior, rGamma_prior, rIndependent_Normal_Gamma_prior, rNormal_Gamma_prior, rNormal_prior, simulate_prior - 0.9.62026-06-21 · diff ↗ ·
removed 9 exports
add_to_libpath_linux, add_to_path_linux, add_to_path_windows, check_runtime_env, detect_compute_runtimes, detect_environment_and_gpus, detect_or_install_gpu_drivers, gpu_names, verify_opencl_runtimeadded 4 exports
dBeta, multi_prior_setup, rBeta_reg, rGamma_Conjugate_reg - 0.9.52026-05-18 · diff ↗
- 0.9.32026-05-04
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-05-04
- Total releases
- 6 / 1 yrs
- License
- GPL-2 OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 127 KB / 6 files
- Download size
- 3.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("glmbayes")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.