plot_latent: Plot the fitted latent trajectory

View source: R/plot.R

plot_latentR Documentation

Plot the fitted latent trajectory

Description

Shows the posterior median of the latent state (log-rate for the Poisson family, logit for the binomial family, one additive-log-ratio series per non-baseline category for the multinomial family) with a credible band.

Usage

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

Arguments

object

A "dynamic_fit" object.

level

Credible level for the band. 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 summary data frame used for plotting (in long format with a category column for the multinomial family).

Examples

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

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