Skip to contents

Creates a density plot overlaying the posterior predictive density over the observed data. This plot allows you to compare the distribution of observed data with the distribution predicted by the model, using posterior predictive draws. It is useful for evaluating how well the model captures the data distribution.

Usage

biPOD_ppc_dens_overlay(x, x_fit, n = 500)

Arguments

x

A bipod object containing a 'counts' field with the observed data. This data is typically a time series or count data.

x_fit

A fitted model object that contains posterior draws of the replicated data (yrep). This model should have been fitted to the data.

n

An integer specifying the number of posterior predictive draws to use in the plot. (default is 500). The more draws used, the smoother the density overlay will be.

Value

A density plot generated using bayesplot::ppc_dens_overlay. The plot overlays the posterior predictive distribution with the observed data.