plot_zero_inflation: Plot zero-inflation diagnostics

View source: R/plot.R

plot_zero_inflationR Documentation

Plot zero-inflation diagnostics

Description

Bar chart of the posterior probability that each observed zero is a structural zero (see structural_zero_prob()), one bar per observed zero labelled by its time index, with a dotted reference line at 0.5. Requires a model fitted with zeros = "inflated" (Poisson or binomial family).

Usage

plot_zero_inflation(object, ...)

Arguments

object

A "dynamic_fit" object.

...

Passed to graphics::barplot(); may override the defaults (e.g. main, col).

Value

Invisibly, the structural_zero_prob() data frame.

Examples

sim <- simulate_dynamic_poisson(80, 0.2, 2, zero_inflation = 0.3, seed = 1)
fit <- fit_dynamic_model(sim$y, zero_inflation = TRUE, nsave = 300, nburn = 200,
                         seed = 1)
plot_zero_inflation(fit)

DynCount documentation built on Sept. 28, 2026, 5:10 p.m.