Skip to content

Commit ada6e82

Browse files
committed
Merge branch 'master' into mcmc-hist-dens-alpha
2 parents 255f31d + c95dba7 commit ada6e82

File tree

90 files changed

+10171
-7060
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+10171
-7060
lines changed

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
Package: bayesplot
22
Type: Package
33
Title: Plotting for Bayesian Models
4-
Version: 1.7.2.9000
5-
Date: 2020-05-27
4+
Version: 1.8.1.9000
5+
Date: 2021-06-13
66
Authors@R: c(person("Jonah", "Gabry", role = c("aut", "cre"), email = "[email protected]"),
77
person("Tristan", "Mahr", role = "aut"),
88
person("Paul-Christian", "Bürkner", role = "ctb"),
99
person("Martin", "Modrák", role = "ctb"),
1010
person("Malcolm", "Barrett", role = "ctb"),
1111
person("Frank", "Weber", role = "ctb"),
12-
person("Eduardo", "Coronado Sroka", role = "ctb"))
12+
person("Eduardo", "Coronado Sroka", role = "ctb"),
13+
person("Aki", "Vehtari", role = "ctb"))
1314
Maintainer: Jonah Gabry <[email protected]>
1415
Description: Plotting functions for posterior analysis, MCMC diagnostics,
1516
prior and posterior predictive checks, and other visualizations
@@ -20,8 +21,7 @@ Description: Plotting functions for posterior analysis, MCMC diagnostics,
2021
developers working on a variety of R packages for Bayesian modeling,
2122
particularly (but not exclusively) packages interfacing with 'Stan'.
2223
License: GPL (>= 3)
23-
LazyData: TRUE
24-
URL: https://mc-stan.org/bayesplot
24+
URL: https://mc-stan.org/bayesplot/
2525
BugReports: https://github.com/stan-dev/bayesplot/issues/
2626
SystemRequirements: pandoc (>= 1.12.3), pandoc-citeproc
2727
Depends:

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@ export(ppc_boxplot)
104104
export(ppc_data)
105105
export(ppc_dens)
106106
export(ppc_dens_overlay)
107+
export(ppc_dens_overlay_grouped)
107108
export(ppc_ecdf_overlay)
109+
export(ppc_ecdf_overlay_grouped)
108110
export(ppc_error_binned)
109111
export(ppc_error_hist)
110112
export(ppc_error_hist_grouped)

NEWS.md

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,55 @@
11
<!-- See http://style.tidyverse.org/news.html for advice on writing news -->
22

3+
# bayesplot 1.8.1.9000
34

4-
# bayesplot 1.7.2.9000
5+
* `mcmc_dens()` and `mcmc_dens_overlay()` gain arguments for controlling the
6+
the density calculation. (#258)
57

6-
<!--
7-
(GitHub issue/PR numbers in parentheses)
8-
* Items for next release go here
9-
-->
8+
# bayesplot 1.8.1
109

11-
* On the y axis, `ppc_loo_pit_qq(..., compare = "normal")` now plots standard
12-
normal quantiles calculated from the PIT values (instead of the standardized
13-
PIT values). (#240, #243, @fweber144)
10+
* Fix R cmd check error on linux for CRAN
1411

15-
* New plotting function `ppc_km_overlay()` for outcome variables that are
16-
right-censored. Empirical CCDF estimates of `yrep` are compared with the
17-
Kaplan-Meier estimate of `y`. (#233, #234, @fweber144)
12+
# bayesplot 1.8.0
1813

19-
* CmdStanMCMC objects (from CmdStanR) can now be used with extractor
20-
functions `nuts_params()`, `log_posterior()`, `rhat()`, and
21-
`neff_ratio()`. (#227)
14+
### Bug fixes
2215

23-
* Added missing `facet_args` argument to `mcmc_rank_overlay()`. (#221, @hhau)
16+
* `mcmc_areas()` tries to use less vertical blank space. (#218, #230)
2417

25-
* Size of points and interval lines can set in
26-
`mcmc_intervals(..., outer_size, inner_size, point_size)`. (#215, #228, #229)
27-
28-
* `mcmc_areas()` tries to use less blank vertical blank space. (#218, #230)
18+
* Fix bug in `color_scheme_view()` minimal theme (#213).
2919

20+
* Fix error in `mcmc_acf()` for certain input types. (#244, #245, @hhau)
21+
22+
### New features
23+
24+
* New plotting functions `ppc_dens_overlay_grouped()` and `ppc_ecdf_overlay_grouped()`
25+
for plotting density and cumulative distributions of the posterior predictive
26+
distribution (versus observed data) by group. (#212)
27+
28+
* New plotting function `ppc_km_overlay()` for outcome variables that are
29+
right-censored. Empirical CCDF estimates of `yrep` are compared with the
30+
Kaplan-Meier estimate of `y`. (#233, #234, @fweber144)
31+
3032
* `ppc_loo_pit_overlay()` now uses a boundary correction for an improved kernel
3133
density estimation. The new argument `boundary_correction` defaults to TRUE but
3234
can be set to FALSE to recover the old version of the plot. (#171, #235,
3335
@ecoronado92)
3436

3537
* `mcmc_hist()` and `mcmc_dens()` gain argument `alpha` for controling transparency. (#244)
3638

39+
* CmdStanMCMC objects (from CmdStanR) can now be used with extractor
40+
functions `nuts_params()`, `log_posterior()`, `rhat()`, and
41+
`neff_ratio()`. (#227)
42+
43+
* On the y axis, `ppc_loo_pit_qq(..., compare = "normal")` now plots standard
44+
normal quantiles calculated from the PIT values (instead of the standardized
45+
PIT values). (#240, #243, @fweber144)
46+
47+
* `mcmc_rank_overlay()` gains argument `facet_args`. (#221, @hhau)
48+
49+
* For `mcmc_intervals()` the size` of the points and interval lines can be set with
50+
`mcmc_intervals(..., outer_size, inner_size, point_size)`. (#215, #228, #229)
51+
52+
3753

3854
# bayesplot 1.7.2
3955

@@ -54,39 +70,39 @@ matrices also inheriting from "array" in R 4.0.
5470
examples. (#161, #183, #188)
5571

5672
* Two new plots have been added for inspecting the distribution of ranks.
57-
Rank histograms were introduced by the Stan team's [new paper on
73+
Rank histograms were introduced by the Stan team's [new paper on
5874
MCMC diagnostics](https://arxiv.org/abs/1903.08008). (#178, #179)
5975

6076
`mcmc_rank_hist()`: A traditional traceplot (`mcmc_trace()`) visualizes how
6177
sampled values the MCMC chains mix over the course of sampling. A rank
6278
histogram (`mcmc_rank_hist()`) visualizes how the *ranks* of values from the
6379
chains mix together. An ideal plot would show the ranks mixing or overlapping
6480
in a uniform distribution.
65-
81+
6682
`mcmc_rank_overlay()`: Instead of drawing each chain's histogram in a separate
6783
panel, this plot draws the top edge of the chains' histograms in a single
6884
panel.
69-
85+
7086
* Added `mcmc_trace_data()`, which returns the data used for plotting the trace
7187
plots and rank histograms. (Advances #97)
7288

73-
* [ColorBrewer](http://colorbrewer2.org) palettes are now available as color
89+
* [ColorBrewer](https://colorbrewer2.org/) palettes are now available as color
7490
schemes via
7591
[`color_scheme_set()`](https://mc-stan.org/bayesplot/reference/bayesplot-colors.html).
76-
For example, `color_scheme_set("brewer-Spectral")` will use the Spectral
92+
For example, `color_scheme_set("brewer-Spectral")` will use the Spectral
7793
palette. (#177, #190)
7894

79-
* MCMC plots now also accept objects with an `as.array` method as
95+
* MCMC plots now also accept objects with an `as.array` method as
8096
input (e.g., stanfit objects). (#175, #184)
8197

8298
* [`mcmc_trace()`](https://mc-stan.org/bayesplot/reference/MCMC-traces.html)
8399
gains an argument `iter1` which can be used to label the traceplot starting
84100
from the first iteration after warmup. (#14, #155, @mcol)
85101

86102
* [`mcmc_areas()`](https://mc-stan.org/bayesplot/reference/MCMC-intervals.html)
87-
gains an argument `area_method` which controls how to draw the density
88-
curves. The default `"equal area"` constrains the heights so that the curves
89-
have the same area. As a result, a narrow interval will appear as a spike
103+
gains an argument `area_method` which controls how to draw the density
104+
curves. The default `"equal area"` constrains the heights so that the curves
105+
have the same area. As a result, a narrow interval will appear as a spike
90106
of density, while a wide, uncertain interval is spread thin over the _x_ axis.
91107
Alternatively `"equal height"` will set the maximum height on each curve to
92108
the same value. This works well when the intervals are about the same width.
@@ -113,12 +129,12 @@ matrices also inheriting from "array" in R 4.0.
113129
* The examples in
114130
[`?ppc_loo_pit_overlay()`](https://mc-stan.org/bayesplot/reference/PPC-loo.html)
115131
now work as expected. (#166, #167)
116-
117-
* Added `"viridisD"` as an alternative name for `"viridis"` to the supported
132+
133+
* Added `"viridisD"` as an alternative name for `"viridis"` to the supported
118134
colors.
119135

120-
* Added `"viridisE"` (the [cividis](https://github.com/marcosci/cividis)
121-
version of viridis) to the supported colors.
136+
* Added `"viridisE"` (the [cividis](https://github.com/marcosci/cividis)
137+
version of viridis) to the supported colors.
122138

123139
* `ppc_bars()` and `ppc_bars_grouped()` now allow negative integers as input.
124140
(#172, @jeffpollock9)
@@ -161,7 +177,7 @@ matrices also inheriting from "array" in R 4.0.
161177
gains an argument `discrete`, which is `FALSE` by default, but can be used
162178
to make the Geom more appropriate for discrete data. (#145)
163179

164-
* [PPC intervals
180+
* [PPC intervals
165181
plots](https://mc-stan.org/bayesplot/reference/PPC-intervals.html) and [LOO
166182
predictive checks](https://mc-stan.org/bayesplot/reference/PPC-loo.html) now
167183
draw both an outer and an inner probability interval, which can be

R/bayesplot-colors.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ plot_scheme <- function(scheme = NULL) {
230230
legend_none() +
231231
xaxis_text(
232232
face = "bold",
233-
margin = margin(t = -3, b = 10),
233+
margin = margin(t = -3, b = 10, unit = "pt"),
234234
angle = 0,
235+
vjust = 1,
235236
debug = FALSE
236237
)
237238
}

R/bayesplot-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#'
4545
#' @section Resources:
4646
#' * __Online documentation and vignettes__: Visit the __bayesplot__ website at
47-
#' <https://mc-stan.org/bayesplot>
47+
#' <https://mc-stan.org/bayesplot/>
4848
#' * __Bug reports and feature requests__: If you would like to request a new
4949
#' feature or if you have noticed a bug that needs to be fixed please let us
5050
#' know at the **bayesplot** issue tracker at

R/mcmc-diagnostics.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,8 +580,7 @@ acf_data <- function(x, lags) {
580580
abort(paste0("Too few iterations for lags=", lags, "."))
581581
}
582582

583-
data <- reshape2::melt(x, value.name = "Value")
584-
data$Chain <- factor(data$Chain)
583+
data <- melt_mcmc(x)
585584
ac_list <- tapply(
586585
data[["Value"]],
587586
# INDEX = list(data[["Chain"]], data[["Parameter"]]),

0 commit comments

Comments
 (0)