For models where brms provides pp_check support, this method delegates to
brms::pp_check(). For models with multinomial families (e.g., the m3
model), brms's pp_check is unavailable; this method dispatches to a
model-specific visualisation instead.
Usage
# S3 method for class 'bmmfit'
pp_check(object, type = "dens_overlay", ndraws = NULL, group = NULL, ...)Arguments
- object
A
bmmfitobject returned bybmm().- type
Character. Type of pp_check (default
"dens_overlay"). For non-multinomial models, passed tobrms::pp_check(). Whengroupis specified, the grouped variant (e.g.,"dens_overlay_grouped") is auto-selected if available. Multinomial models produce a response proportion profile regardless of the value supplied.- ndraws
Integer. Number of posterior draws. Defaults to
100for multinomial models; otherwise passed tobrms::pp_check().- group
Character. Optional grouping variable for faceting. For non-multinomial models, passed to
brms::pp_check(); when specified, the grouped variant oftype(e.g.,"dens_overlay_grouped") is auto-selected if available. For multinomial models, facets by the named predictor.- ...
Additional arguments forwarded to
brms::pp_check()(non-multinomial) or tobrms::posterior_predict()(multinomial). For multinomial models,probs(numeric vector of length 2, defaultc(0.025, 0.975)) controls the credible interval. Both model types acceptre_formula(e.g.,re_formula = NAto predict at the population level, excluding random effects).
Value
For multinomial models, a ggplot2 object. For other models, the
result of brms::pp_check().
Details
For multinomial models, the plot mirrors the bayesplot ppc_bars style:
observed proportions are shown as bars and posterior predictive medians with
credible intervals are shown as point-ranges, using the bayesplot default
colour scheme and theme.
