Bayesian Age-Period-Cohort Modeling and Prediction
Overview
Bayesian Age-Period-Cohort Modeling and Prediction using efficient Markov Chain Monte Carlo Methods. This is the R version of the previous BAMP software as described in Volker Schmid and Leonhard Held (2007) DOI:10.18637/jss.v021.i08 Bayesian Age-Period-Cohort Modeling and Prediction - BAMP, Journal of Statistical Software 21:8. This package includes checks of convergence using Gelman's R.
Major release. The Polya-Gamma sampler and its native C engine, DIC-based selectModel(), and the identifiability-aware convergence diagnostics in this release were contributed by Chris Kypridemos.
- New Polya-Gamma Gibbs sampler (
method = "pg", now the default): a joint Polya-Gamma data-augmentation sampler with exact full conditionals and no Metropolis tuning. Supports overdispersion, age/period/cohort heterogeneity and period/cohort covariates natively. The legacy Taylor sampler remains available viamethod = "taylor". - Native C implementation of the Polya-Gamma sampler (
pg_engine = "C", the default) with an equivalent pure-R reference (pg_engine = "R"); the two agree to numerical tolerance. mcmc.optionsvaluesnumber_of_iterations,burn_inandstepmay now be set to"auto"(the default), which chooses the MCMC length from the rarity of the data. Any value given as a number is used exactly as before.
Show all changes in 3.0.0Hide the rest of the changes in 3.0.0
- New
selectModel(): automatic APC model selection by DIC. - New
prior_scaleargument formethod = "pg". checkConvergence()now assesses the identified quantities (smoothing precisions, intercept and the fitted linear predictor per Lexis cell), which are invariant to the age-period-cohort trend aliasing, rather than the raw effect chains that drift along the non-identified trend.effects.apc()andplot.apc()gain aconventionargument that fixes the non-identified linear trend to a chosen display gauge, making the effect curves reproducible between runs;plot.apc()also handles any number of quantiles and zero-covariate models.print.apc()now also reports the intercept (5%/50%/95% quantiles).- Fixed
predict_apc(periods = 0)crash (downward-sequence off-by-one). - Fixed
predict_apc()logit overflow: useplogis()instead ofexp(x)/(1+exp(x)), which returnedNaNfor large forecast logits and crashed downstream. - Fixed
bamp():age/period/cohort = NULLis now accepted (previously errored with "argument is of length zero"). - Fixed
predict_apc(): age-period models without a cohort effect can now be predicted, and non-integer population/exposure no longer producesNA. bamp(..., method = "pg"): a chain that fails under forked parallelism (parallel::mclapply) now reports its actual error instead of the opaque "subscript out of bounds" that resulted from silently indexing into the failed chain's result.- Fixed
bamp()'s convergence warning being tied toverbosebackwards: it now prints the "did not converge" message whenverbose = TRUEand stays silent whenverbose = FALSE, as intended.
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-10
Show 1 earlier changeHide 1 earlier change
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 11
- Examples that run
- 33%3 run in a plain check · 6 never run
- Exported functions with examples
- 86%
- Documented parameters
- 86%
- Return-value docs
- 86%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- 3
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
8 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/volkerschmid/bamp on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
GitHub Pages site last deployed 2026-08-31 · The repository has a site deploy workflow
pkgdown site last built 2026-08-08, before release 3.0.0 (2026-08-31)
This repository shows signs of AI coding tools.
- Claude Codefirst seen on or before 2026-07-03Commits: at least 12 crediting it in the message
- Claude Opus 4.812 commits · Jul 2026
Dependencies
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- 3.0.0Latest
- 2.2.02026-06-21 · diff ↗
- 2.1.52026-06-06 · diff ↗
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- 2.1.32022-10-18 · diff ↗
- 2.1.12022-05-05 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 2.1.02021-06-10 · diff ↗
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- unarchivedReturned to CRAN2020-01-23
- 2.0.82020-01-23 · diff ↗
- archivedRemoved from CRAN2020-01-16check issues were not corrected in time 'Additional issues'
Package metadata
- First published
- 2018-12-01
- Total releases
- 11 / 8 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 1.3 KB / 1 file
- Download size
- 1.0 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("bamp")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-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.