Skip to contents

Overlays the estimated posterior mean density with the N(0,1) reference distribution and, when available, the fitted DP mixture density. Requires ggplot2.

Usage

dpmirt_plot_density_compare(fit, reference = c("normal"), ...)

Arguments

fit

A dpmirt_fit object from dpmirt.

reference

Character. Currently only "normal" is supported, which overlays N(0,1).

...

Currently unused.

Value

A ggplot object.

Examples

if (FALSE) { # \dontrun{
sim <- dpmirt_simulate(200, 20, model = "rasch", seed = 42)
fit <- dpmirt(sim$response, model = "rasch", prior = "normal",
              niter = 5000, nburnin = 1000, seed = 123)

# Compare to N(0,1)
dpmirt_plot_density_compare(fit)

} # }