Skip to contents

Fits K independent lame() models (one per panel) and pools the per-panel beta posteriors into a precision-weighted shared posterior. Returns a list with the per-panel fits, the pooled beta posterior, and the panel-specific deviations.

Usage

lame_multi(Y_list, Xdyad_list, ...)

Arguments

Y_list

A list of length K, each element a list (or 3-D array) of T per-panel network observations.

Xdyad_list

A list of length K, each element a list of T dyadic covariate arrays.

...

Arguments forwarded to lame() (e.g. family, R, mode, nscan, burn, odens, dynamic_beta, dynamic_beta_kind). The pooled beta posterior is always returned, per-period when dynamic_beta is active (detected from the panel fits).

Value

A list with

  • fits: list of K per-panel lame fits.

  • beta_shared: pooled posterior mean of beta (per-period when dynamic).

  • beta_deviations: list of K panel-specific deviations from beta_shared.

  • K: number of panels.

Class "lame_multi".

Details

This is an R-level wrapper: it fits each panel with its own MCMC and pools the results afterwards. The pooling is exact when the panels are conditionally independent given beta, which is the standard assumption.

See also

lame_parallel for the unrelated multi-chain wrapper that runs K MCMC chains of the same model (used for R-hat / ESS diagnostics and pooled effective sample size). lame_multi is for K distinct panels with shared regression coefficients; lame_parallel is for K chains of one model.

Examples

# \donttest{
data(YX_bin_list)
fit_multi <- lame_multi(
  Y_list = list(YX_bin_list$Y, YX_bin_list$Y),
  Xdyad_list = list(YX_bin_list$X, YX_bin_list$X),
  family = "binary", R = 0,
  nscan = 100, burn = 25, odens = 5, verbose = FALSE)
dim(fit_multi$beta_shared)
#> NULL
# }