Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: bayesplot
Type: Package
Title: Plotting for Bayesian Models
Version: 1.15.0.9000
Date: 2025-12-11
Version: 1.16.0
Date: 2026-08-24
Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"), email = "jgabry@gmail.com"),
person("Tristan", "Mahr", role = "aut", comment = c(ORCID = "0000-0002-8890-5116")),
person("Paul-Christian", "Bürkner", role = "ctb"),
Expand Down
99 changes: 61 additions & 38 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,64 @@
# bayesplot (development version)

* Fixed bug in `mcmc_pairs()` (introduced in bayesplot 1.10.0) where some panels' divergences/treedepth hits were missing(#555)
* Unified density-control argument defaults (`bw`, `adjust`, `kernel`, `n_dens`) to use `NULL` with internal fallbacks. No change in user-facing behavior.
* `prepare_mcmc_array()` now warns instead of erroring on `NA`s in the input.
* Fixed `validate_chain_list()` colnames check to compare all chains, not just the first two.
* Added test verifying `legend_move("none")` behaves equivalently to `legend_none()`.
* Added singleton-dimension edge-case tests for exported `_data()` functions.
* Validate empty list and zero-row matrix inputs in `nuts_params.list()`.
* Validate user-provided `pit` values in `ppc_loo_pit_data()` and `ppc_loo_pit_qq()`, rejecting non-numeric inputs, missing values, and values outside `[0, 1]`.
* New `show_marginal` argument to `ppd_*()` functions to show the PPD - the marginal predictive distribution by @mattansb (#425)
* `ppc_ecdf_overlay()`, `ppc_ecdf_overlay_grouped()`, and `ppd_ecdf_overlay()` now always use `geom_step()`. The `discrete` argument is deprecated.
* Fixed missing `drop = FALSE` in `nuts_params.CmdStanMCMC()`.
* Replace `apply()` with `storage.mode()` for integer-to-numeric matrix conversion in `validate_predictions()`.
* Fixed `is_chain_list()` to correctly reject empty lists instead of silently returning `TRUE`.
* Added unit tests for `mcmc_areas_ridges_data()`, `mcmc_parcoord_data()`, and `mcmc_trace_data()`.
* `mcmc_trace()` now supports highlighting a chain with lines using the `highlight` and `alpha` arguments. Previously this was only available via `mcmc_trace_highligh()` and with points instead of lines. (#552)
* Added unit tests for `ppc_error_data()` and `ppc_loo_pit_data()` covering output structure, argument handling, and edge cases.
* Added vignette sections demonstrating `*_data()` companion functions for building custom ggplot2 visualizations (#435)
* Extract `drop_singleton_values()` helper in `mcmc_nuts_treedepth()` to remove duplicated filtering logic.
* Eliminate redundant data processing in `mcmc_areas_data()` by reusing the prepared MCMC array for both interval and density computation.
* Validate equal chain lengths in `validate_df_with_chain()`, reject missing chain labels, and renumber data-frame chain labels internally when converting to arrays.
* Added unit tests for previously untested edge cases in `param_range()`, `param_glue()`, and `tidyselect_parameters()` (no-match, partial-match, and negation behavior).
* Bumped minimum version for `rstantools` from `>= 1.5.0` to `>= 2.0.0` .
* Use `rlang::warn()` and `rlang::inform()` for selected PPC user messages instead of base `warning()` and `message()`.
* Standardize input validation errors in `ppc_km_overlay()` and interpolation helpers to use `rlang::abort()` for consistent error handling.
* Fix assignment-in-call bug in `mcmc_rank_ecdf()` (#).
* Replaced deprecated `dplyr` and `tidyselect` functions (`top_n`, `one_of`, `group_indices`) with their modern equivalents to ensure future compatibility. (#431)
* Documentation added for all exported `*_data()` functions (#209)
* Improved documentation for `binwidth`, `bins`, and `breaks` arguments to clarify they are passed to `ggplot2::geom_area()` and `ggdist::stat_dots()` in addition to `ggplot2::geom_histogram()`
* Improved documentation for `freq` argument to clarify it applies to frequency polygons in addition to histograms
* Fixed test in `test-ppc-distributions.R` that incorrectly used `ppc_dens()` instead of `ppd_dens()` when testing PPD functions
* New functions `mcmc_dots` and `mcmc_dots_by_chain` for dot plots of MCMC draws by @behramulukir (#402)
* Default to `quantiles=100` for all dot plots by @behramulukir (#402)
* Use `"neff_ratio"` consistently in diagnostic color scale helpers to avoid relying on partial matching of `"neff"`.
* Replace `expand = c(mult, add)` with `ggplot2::expansion()` helper in scale functions for consistency with ggplot2 >= 3.3.0 style.
* Replace uses of `geom_bar(stat = "identity")` with the more idiomatic ggplot2 form `geom_col()`
* New function `ppc_rootogram_grouped` for grouped rootogram plots by @behramulukir and @jgabry (#419)
# bayesplot 1.16.0

### New plots and plotting capabilities

* `mcmc_dots()` and `mcmc_dots_by_chain()` are new quantile dot plots for
MCMC draws. All dot-plot functions now default to `quantiles = 100`.
@behramulukir (#402)
* `ppc_calibration()` and the new grouped, overlay, LOO, and `_data()`
variants provide calibration plots for models with binary outcomes.
@TeemuSailynoja and @florence-bockting (#352)
* `ppc_loo_pit_ecdf()`, `ppc_pit_ecdf()`, and
`ppc_pit_ecdf_grouped()` gain `method = "correlated"` for
dependence-aware uniformity tests and visualization of influential ECDF
regions. The existing `"independent"` method remains the default but is
superseded. @florence-bockting (#428)
* `ppc_rootogram_grouped()` is a new grouped and faceted rootogram supporting
all existing rootogram styles. @behramulukir and @jgabry (#419)
* `ppd_*()` distribution and test-statistic functions gain `show_marginal` for
adding the marginal predictive distribution; defaults are unchanged.
@mattansb (#425)

### Other improvements and behavior changes

* `mcmc_areas()`, `mcmc_areas_ridges()`, `mcmc_dens()`,
`mcmc_dens_chains()`, and `mcmc_dens_overlay()` gain a `bounds` argument
for bounded density estimation, as do their `_data()` companions and the
PPC and PPD density functions. @VisruthSK (#317)
* `mcmc_trace()` now officially supports the `highlight` and `alpha`
arguments for highlighting a chain with lines. @jgabry (#552)
* `ppc_*()` and `ppd_*()` functions now accept `posterior::draws` objects for
predictive draws. @ishaan-arora-1 (#542)
* `ppc_ecdf_overlay()`, `ppc_ecdf_overlay_grouped()`, and
`ppd_ecdf_overlay()` now always draw ECDFs as step functions; their
`discrete` argument is deprecated. @utkarshpawade (#259)
* `prepare_mcmc_array()` now warns rather than errors when draws contain
`NA`s, allowing MCMC plots of ragged arrays padded with missing values. It
also rejects unequal chain lengths and mismatched parameter names that
could previously corrupt or misalign draws. @utkarshpawade
(#250, #498, #528)

### Bug fixes and compatibility

* Improved compatibility with ggplot2 4.0 and current dplyr and tidyselect
releases, eliminating deprecation and small-group warnings and fixing
linetype legends. @jgabry, @BjarkeHautop, @ishaan-arora-1, and
@utkarshpawade (#410, #412, #414, #442, #446, #448, #450, #458, #468)
* `mcmc_pairs()` now correctly marks divergences and maximum-treedepth hits in
every panel; a regression introduced in bayesplot 1.10.0 could omit or
misassign them. @jgabry (#555)
* `nuts_params()` preserves array dimensions when a single parameter is
selected from a `CmdStanMCMC` object and gives clear errors for empty or
zero-row list inputs. @utkarshpawade (#530, #534)
* `ppc_loo_pit_data()` now validates user-supplied `pit` values at the entry
point and rejects nonnumeric, missing, or out-of-range inputs.
@utkarshpawade (#503)


There were many other non user-facing changes, including internal refactoring
and improved test coverage. The full changelog can be found at:
https://github.com/stan-dev/bayesplot/compare/v1.15.0...v1.16.0


# bayesplot 1.15.0

Expand Down
19 changes: 11 additions & 8 deletions R/ppc-calibration.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' PPC calibration
#'
#' Assess the calibration of the predictions, or predictive probabilites in relation to
#' binary observations.
#' See the **Plot Descriptions** section, below, for details.
#' Assess the calibration of the predictions, or predictive probabilities in
#' relation to binary observations. See the **Plot Descriptions** and
#' **Details** sections below and also the PPC Calibration vignette for more
#' details and examples.
#'
#' @name PPC-calibration
#' @family PPCs
Expand All @@ -19,8 +20,8 @@
#' @template return-ggplot-or-data
#'
#' @details
#' The ppc_calibration functions are designed to assess the calibration of a
#' model with binary outcomes. In this context, calibration refers to the
#' The PPC calibration functions are designed to assess the calibration of a
#' model with binary outcomes. In this context, calibration refers to the
#' agreement between predicted probabilities and conditional event probabilities
#' (CEPs) see Dimitriadis et al. (2021) and Säilynoja et al. (2025) for details.
#'
Expand All @@ -31,9 +32,11 @@
#' `ppc_loo_calibration()`, and `ppc_loo_calibration_grouped()` accept either
#' `prep` or `yrep`.
#'
#' A document with detailed explanations and examples is available in the
#' [vignettes](https://mc-stan.org/bayesplot/vignettes/articles-online-only/).
#'
#' `prep` or `yrep`.
#'
#' A document with detailed explanations and examples is available in the
#' [vignettes](https://mc-stan.org/bayesplot/articles/).
#'
#' @section Plot Descriptions:
#' \describe{
#' \item{`ppc_calibration()`,`ppc_calibration_grouped()`}{
Expand Down
3 changes: 3 additions & 0 deletions R/ppc-overview.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@
#' distribution of censored data `y` to the distributions of individual
#' simulated datasets (rows) in `yrep`.
#'
#' * [PPC-calibration]: PPC functions to assess the calibration of predictions
#' or predictive probabilities in relation to binary observations.
#'
#' @section Providing an interface for predictive checking from another package:
#'
#' In addition to the various plotting functions, the **bayesplot** package
Expand Down
8 changes: 4 additions & 4 deletions _pkgdown.yml
Comment thread
jgabry marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ articles:
- plotting-mcmc-draws
- visual-mcmc-diagnostics
- graphical-ppcs
- articles-online-only/ppc-calibration
- title: "PIT-ECDF model checking"
- title: "Additional topics"
desc: >
Articles on dependence-aware PIT-ECDF checks (website only; not included
in the CRAN package).
Articles on specific topics like calibration for binary models and
dependence-aware PIT-ECDF checks
contents:
- articles-online-only/ppc-calibration
- articles-online-only/loo-pit-correlated-tests

reference:
Expand Down
15 changes: 9 additions & 6 deletions man/PPC-calibration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-censoring.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-discrete.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-distributions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-errors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-intervals.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-loo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/PPC-overview.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-scatterplots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/PPC-test-statistics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-ppc-errors.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ test_that("ppc_error_binned renders correctly", {

four_draws <- structure(
c(-2.118, -2.061, -2.069, -2.011, 7.604, 9.720, 9.7186, 10.1888),
.Dim = c(4L, 2L),
.Dimnames = list(
dim = c(4L, 2L),
dimnames = list(
iterations = NULL,
parameters = c("(Intercept)", "(phi)")
)
Expand Down
4 changes: 2 additions & 2 deletions vignettes/articles-online-only/loo-pit-correlated-tests.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Model checking using 'ppc_pit_ecdf' and 'ppc_loo_pit_ecdf'"
title: "Model checking using `ppc_pit_ecdf` and `ppc_loo_pit_ecdf`"
author: "Florence Bockting"
date: "`r Sys.Date()`"
output:
Expand Down Expand Up @@ -616,4 +616,4 @@ https://link.springer.com/article/10.1007/S11222-016-9696-4
Vehtari, A., Simpson, D., Gelman, A., Yao, Y., and Gabry, J. (2024). Pareto
smoothed importance sampling. *Journal of Machine Learning Research*, 25(72),
1–58. https://www.jmlr.org/papers/v25/19-556.html
<a id="Vehtari2024"></a>
<a id="Vehtari2024"></a>
4 changes: 2 additions & 2 deletions vignettes/articles-online-only/ppc-calibration.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "PPC Calibration - Calibration of Bayesian models with binary outcomes"
title: "Calibration of Bayesian models with binary outcomes"
author: "Florence Bockting"
date: "`r Sys.Date()`"
output:
Expand All @@ -9,7 +9,7 @@ output:
params:
EVAL: true
vignette: >
%\VignetteIndexEntry{PPC Calibration - Calibration of Bayesian models with binary outcomes}
%\VignetteIndexEntry{Calibration of Bayesian models with binary outcomes}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
Expand Down