Skip to content

Bayesian Age-Period-Cohort Modeling and Prediction

0packages depend
4.7Kdownloads / year
19.4%test coverage
13/13flavors OK

Overview

About

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.

Changes in 3.0.0

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 via method = "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.options values number_of_iterations, burn_in and step may 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_scale argument for method = "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() and plot.apc() gain a convention argument 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: use plogis() instead of exp(x)/(1+exp(x)), which returned NaN for large forecast logits and crashed downstream.
  • Fixed bamp(): age/period/cohort = NULL is 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 produces NA.
  • 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 to verbose backwards: it now prints the "did not converge" message when verbose = TRUE and stays silent when verbose = FALSE, as intended.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 2.9 min · r-devel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 3.0.0
READMEYes · 439 wordsVignettesYes · 4 · staticNEWSYes · 100% structured · mentions 3.0.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Description cites a JSS article
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

4.7K
CRAN downloads in the past year
Rank #5,802 · ~13/day · ~391/mo
Daily download trend is not available in this view yet.
49830 days
1.4K90 days
4.7K1 year
Compare downloads with other packages →
Also on429 r2u45 autocran

Repository

11Stars
4Forks
1Open issues
0Open PRs
1Releases
198Commits
7Commit identities
198 commits · Last activity 2026-08-31 · 0% stars, 30d
Responsiveness
How these are sampled
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

2025-04-04 · 102026-07-07 · 11
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
pkgdown

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)

Reproducibility and dev environment (1)
data-raw/
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen on or before 2026-07-03
    Commits: at least 12 crediting it in the message
Models named in its commits
  • Claude Opus 4.812 commits · Jul 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
6 external dependencies (excludes base and recommended)

Installing bamp adds 2 packages (0 with compiled code, 94 KB of source tarballs). Heaviest: coda 73 KB, abind 21 KB.

Depends (1)
R >= 3.5.0
Imports (5)
codagraphicsparallelstatsabind
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (5)
Author, Maintainer since 2.0.4 (2018)
Author · added in 3.0.0
Contributor
Contributor
Contributor
Releases (11)

Pick two releases to compare their code metrics.

  • 3.0.0Latest
    record
    2026-08-31 · current release · diff ↗ ·
    added 1 export
    selectModel
  • 2.2.0
    record
    2026-06-21 · diff ↗
  • 2.1.5
    record
    2026-06-06 · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • R
    R 4.3.0 released · 2023-04-21
  • 2.1.3
    record
    2022-10-18 · diff ↗
  • 2.1.1
    record
    2022-05-05 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 2.1.0
    record
    2021-06-10 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
  • unarchivedReturned to CRAN
    2020-01-23
  • 2.0.8
    record
    2020-01-23 · diff ↗
  • archivedRemoved from CRAN
    2020-01-16
    check issues were not corrected in time 'Additional issues'
Show 6 earlier eventsHide 6 earlier events

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for bamp version 3.0.0 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy