Skip to content

Commit 184c5a9

Browse files
committed
add release_questions() helper
[ci skip]
1 parent d9b35f2 commit 184c5a9

File tree

4 files changed

+59
-12
lines changed

4 files changed

+59
-12
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ images/*
1313
book/*
1414
docs/*
1515
Rplots.pdf
16+
tests/figs/*

R/bayesplot-package.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,13 @@
9191
#' }
9292
#'
9393
NULL
94+
95+
96+
# internal ----------------------------------------------------------------
97+
98+
# release reminders (for devtools)
99+
release_questions <- function() { # nocov start
100+
c(
101+
"Have you reduced the size of the vignettes for CRAN?",
102+
)
103+
} # nocov end

vignettes/plotting-mcmc-draws.Rmd

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,18 @@ transform the draws in advance or use the `transformations` argument.
166166

167167
```{r, mcmc_hist-transform, message=FALSE}
168168
color_scheme_set("blue")
169-
mcmc_hist(posterior, pars = c("wt", "sigma"),
169+
mcmc_hist(posterior, pars = c("wt", "sigma"),
170170
transformations = list("sigma" = "log"))
171171
```
172172

173+
<!-- ```{r, mcmc_hist-transform, message=FALSE, eval=FALSE} -->
174+
<!-- # not evaluated to reduce vignette size for CRAN -->
175+
<!-- # full version available at mc-stan.org/bayesplot/articles -->
176+
<!-- color_scheme_set("blue") -->
177+
<!-- mcmc_hist(posterior, pars = c("wt", "sigma"), -->
178+
<!-- transformations = list("sigma" = "log")) -->
179+
<!-- ``` -->
180+
173181
Most of the other functions for plotting MCMC draws also have a
174182
`transformations` argument.
175183

@@ -267,6 +275,14 @@ mcmc_pairs(posterior, pars = c("(Intercept)", "wt", "sigma"),
267275
off_diag_args = list(size = 1.5))
268276
```
269277

278+
<!-- ```{r, mcmc_pairs, message=FALSE, eval=FALSE} -->
279+
<!-- # not evaluated to reduce vignette size for CRAN -->
280+
<!-- # full version available at mc-stan.org/bayesplot/articles -->
281+
<!-- color_scheme_set("pink") -->
282+
<!-- mcmc_pairs(posterior, pars = c("(Intercept)", "wt", "sigma"), -->
283+
<!-- off_diag_args = list(size = 1.5)) -->
284+
<!-- ``` -->
285+
270286
The univariate marginal posteriors are shown along the diagonal as histograms,
271287
but this can be changed to densities by setting `diag_fun="dens"`. Bivariate
272288
plots are displayed above and below the diagonal as scatterplots, but it is also
@@ -325,11 +341,18 @@ by side, and `strip.position="left"` moves the facet labels to the y-axis
325341
The [`"viridis"` color scheme](https://CRAN.R-project.org/package=viridis) is
326342
also useful for trace plots because it is comprised of very distinct colors:
327343

328-
```{r, viridis-scheme}
344+
```{r, viridis-scheme, eval=FALSE}
329345
color_scheme_set("viridis")
330346
mcmc_trace(posterior, pars = "(Intercept)")
331347
```
332348

349+
<!-- ```{r, viridis-scheme, eval=FALSE} -->
350+
<!-- # not evaluated to reduce vignette size for CRAN -->
351+
<!-- # full version available at mc-stan.org/bayesplot/articles -->
352+
<!-- color_scheme_set("viridis") -->
353+
<!-- mcmc_trace(posterior, pars = "(Intercept)") -->
354+
<!-- ``` -->
355+
333356
#### mcmc_trace_highlight
334357

335358
The `mcmc_trace_highlight` function uses points instead of lines and reduces the

vignettes/visual-mcmc-diagnostics.Rmd

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,27 @@ visualizations.
253253

254254
#### mcmc_parcoord
255255

256-
The parallel coordinates plot (`mcmc_parcoord`) is probably the first plot to
257-
have look at if you have no idea, where the divergences in your model might be
258-
coming from. This function works in general without including information about
259-
the divergences, but if the optional `np` argument is used to pass NUTS
260-
parameter information, then divergences will be colored in the plot (by default
261-
in red).
256+
The `mcmc_parcoord` plot shows one line per iteration, connecting the parameter
257+
values at this iteration. This lets you see global patterns in the divergences.
258+
259+
This function works in general without including information about the
260+
divergences, but if the optional `np` argument is used to pass NUTS parameter
261+
information, then divergences will be colored in the plot (by default in red).
262262

263263
```{r, mcmc_parcoord-1}
264264
color_scheme_set("darkgray")
265265
mcmc_parcoord(posterior_cp, np = np_cp)
266266
```
267267

268-
The `mcmc_parcoord` plot shows one line per iteration, connecting the parameter
269-
values at this iteration. This lets you see any global patterns in the
270-
divergences. Here, you may notice that divergences in the centered
268+
269+
<!-- ```{r, mcmc_parcoord-1, eval=FALSE} -->
270+
<!-- # not evaluated to reduce vignette size for CRAN -->
271+
<!-- # full version available at mc-stan.org/bayesplot/articles -->
272+
<!-- color_scheme_set("darkgray") -->
273+
<!-- mcmc_parcoord(posterior_cp, np = np_cp) -->
274+
<!-- ``` -->
275+
276+
Here, you may notice that divergences in the centered
271277
parameterization happen exclusively when `tau`, the hierarchical standard
272278
deviation, goes near zero and the values of the `theta`s are essentially fixed.
273279
This makes `tau` immediately suspect.
@@ -289,10 +295,17 @@ Let's look at how `tau` interacts with other variables, using only one of the
289295
`theta`s to keep the plot readable:
290296

291297
```{r, mcmc_pairs}
292-
mcmc_pairs(posterior_cp, np = np_cp, pars = c("mu","tau","theta[1]"),
298+
mcmc_pairs(posterior_cp, np = np_cp, pars = c("mu","tau","theta[1]"),
293299
off_diag_args = list(size = 0.75))
294300
```
295301

302+
<!-- ```{r, mcmc_pairs, eval=FALSE} -->
303+
<!-- # not evaluated to reduce vignette size for CRAN -->
304+
<!-- # full version available at mc-stan.org/bayesplot/articles -->
305+
<!-- mcmc_pairs(posterior_cp, np = np_cp, pars = c("mu","tau","theta[1]"), -->
306+
<!-- off_diag_args = list(size = 0.75)) -->
307+
<!-- ``` -->
308+
296309
Note that each bivariate plot is present twice -- by default each of those
297310
contain half of the chains, so you also get to see if the chains produced
298311
similar results (see the documentation for the `condition` argument for

0 commit comments

Comments
 (0)