Skip to contents

Plot density of observed vs replicated data

Usage

plot_ppc_density(fit, ppd = NULL, rel = 1, time = NULL, Y_obs = NULL)

Arguments

fit

A dbn model fit object

ppd

Posterior predictive samples

rel

Relation index

time

Time indices

Y_obs

Observed data array (required)

Value

A ggplot object or NULL

Examples

# \donttest{
sim <- simulate_static_dbn(n = 6, time = 5, seed = 1)
fit <- dbn(sim$Y, model = "static", nscan = 200, burn = 100, verbose = FALSE)
ppd <- posterior_predict_dbn(fit, ndraws = 5)
if (requireNamespace("ggplot2", quietly = TRUE)) plot_ppc_density(fit, ppd, Y_obs = sim$Y)

# }