plot_fitted: Plot observed versus fitted values

View source: R/plot.R

plot_fittedR Documentation

Plot observed versus fitted values

Description

Observed series with the posterior median fitted mean and a credible band on the response scale. For the multinomial family, one panel per category showing the observed and expected counts N_t p_{t,k}.

Usage

plot_fitted(object, level = 0.95, category = NULL, ...)

Arguments

object

A "dynamic_fit" object.

level

Credible level. Default 0.95.

category

Multinomial family only: which categories to draw (names or indices among the non-baseline categories for plot_latent(); among all K categories for plot_fitted() and plot_forecast()). NULL (default) draws one panel per category.

...

Passed to graphics::plot(); may override the default main, xlab, ylab, ylim and other plot arguments.

Value

Invisibly, the fitted summary.

Examples

sim <- simulate_dynamic_poisson(60, 0.2, 2, seed = 1)
fit <- fit_dynamic_model(sim$y, nsave = 300, nburn = 200, seed = 1)
plot_fitted(fit)

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