Skip to contents

Selects a plot based on the node's kind:

Usage

bg_plot(project, node_id, ...)

Arguments

project

A bg_handle.

node_id

The node to plot.

...

Passed to the underlying bayesplot function (ignored for the base-graphics kinds).

Value

For ppc and fit kinds, the bayesplot ggplot object. For loo_pit and sbc, NULL invisibly (the plot is drawn as a side effect).

Details

The bayesplot-backed kinds need the bayesplot package (a soft dependency); the function aborts with an informative message when it is missing or the node kind has no plot.

For posterior-predictive checking, this graphical view is the primary diagnostic: the p-values in a ppc node's summary are conservative checks that flag substantial misfit. An unremarkable p-value is weak evidence of adequacy. Inspect the overlay alongside the p-values.