brms's plot() of a fit: for each selected parameter a histogram and
a trace of its draws, nvariables parameters to a page, drawn with
bayesplot::mcmc_combo(). The arguments are brms's, in brms's order
and with brms's defaults. Without pars or variable the parameters
are the model's outer parameters (no group-level coefficients), as
brms leaves out its r_ draws.
Arguments
- x
A
frmtmb_drawsfromfrm_sample().- pars, variable, regex, fixed
Which parameters, by brms's rule:
variableis exact names unlessregex = TRUE;parsis a regular expression unlessfixed = TRUE, and wins when both are given.- combo
The two bayesplot panel types, as in brms.
- nvariables
Parameters per page.
- N
brms's deprecated alias of
nvariables, with brms's warning.- bins
Histogram bins.
- theme
A ggplot2 theme for the panels.
- plot
If
FALSE, return the pages without drawing them.- ask
Whether to ask before each page after the first.
- newpage
Whether the first page starts a new page.
- ...
Passed to
bayesplot::mcmc_combo().
Examples
# \donttest{
if (requireNamespace("tmbstan", quietly = TRUE) &&
requireNamespace("rstan", quietly = TRUE) &&
requireNamespace("bayesplot", quietly = TRUE) &&
!frmtmb.sample:::tmbstan_build_broken()) {
set.seed(1)
dd <- data.frame(x = rnorm(40))
dd$y <- rnorm(40, 1 + 0.5 * dd$x, 1)
ds <- frm_sample(bf(y ~ x), family = gaussian(), data = dd,
chains = 1, iter = 400, refresh = 0)
plot(ds, variable = "^b_", regex = TRUE, ask = FALSE)
}
#> frm_sample(): default priors (brms 2.23 defaults; prior = "flat" puts brms's (flat) in every slot)
#> Intercept student_t(3, 1.1, 2.5)
#> sigma student_t(3, 0, 2.5) [natural scale]
#> b (flat), as brms leaves slopes
#> Warning: Bulk Effective Samples Size (ESS) is too low, indicating posterior means and medians may be unreliable.
#> Running the chains for more iterations may help. See
#> https://mc-stan.org/misc/warnings.html#bulk-ess
# }