Skip to contents

Computes posterior summaries of the baseline mean matrix M, which captures persistent dyad-specific tendencies (e.g., stable alliances or rivalries) that do not change over time. Returns a data frame with one row per dyad, suitable for plotting or comparison against known ground truth in simulation studies.

Usage

latent_summary(fit, fun = mean, draws = NULL, rel = NULL, chunk = 20)

Arguments

fit

A fitted dbn object returned by dbn().

fun

Summary function applied across posterior draws (default: mean). Use median for a robust alternative, or a custom function.

draws

Integer vector of posterior draw indices to use. If NULL (default), all available draws are used.

rel

Integer vector of relation indices to summarize. If NULL (default), all relations are included.

chunk

Integer controlling memory-efficient processing. Draws are processed in blocks of this size. Only relevant for very large fits.

Value

Data frame with columns i (sender), j (receiver), rel, and value (the summary statistic).

Examples

# \donttest{
sim <- simulate_dynamic_dbn(n = 6, time = 5, seed = 1)
fit <- dbn(sim$Y, model = "dynamic", nscan = 200, burn = 100, verbose = FALSE)
ls <- latent_summary(fit)
# }