Skip to contents

ame_parallel(Y, n_chains = k, ...) is ame(Y, chains = k, ...): the same chains (seeds seed + 1000 * (k - 1)), the same drift check, between-chain gate and extensions, and the same pooled fit. It is kept for the older argument names; combine_method = "list" returns the fits of the chains instead of the pooled fit.

Usage

ame_parallel(
  Y,
  n_chains = 4,
  cores = n_chains,
  combine_method = c("pool", "list"),
  fitter = c("auto", "ame", "lame"),
  ...
)

Arguments

Y

Network data matrix

n_chains

Number of chains to run (default = 4)

cores

Number of CPU cores to use: the chains run forked on Unix (one core per chain at most) and one after the other on Windows. Default is n_chains. Use 1 for sequential processing.

combine_method

Method for combining chains: "pool" (default) or "list"

fitter

Which fitter to use: "auto" (default; pick lame when Y is a list / 3-D array with >1 time slice, else ame), "ame" (force cross-sectional), or "lame" (force longitudinal – required for dynamic_* flags).

...

Additional arguments passed to ame() or lame().

Value

If combine_method = "pool": A single ame object with pooled chains If combine_method = "list": A list of ame objects, one per chain. A call whose chains are not settled after the extensions returns the fit with a warning of class lame_chain_unsettled and fit$auto_extend$settled = FALSE (see ame).

See also

lame_multi for the unrelated multi-panel wrapper that fits K distinct networks with shared regression coefficients. ame_parallel / lame_parallel run K MCMC chains of the same model (for R-hat / ESS diagnostics); lame_multi runs one chain across K panels with pooled beta.

Author

Cassy Dorff, Shahryar Minhas, Tosin Salau

Examples

# \donttest{
# Run 2 chains sequentially
data(YX_nrm)
fit_parallel <- ame_parallel(YX_nrm$Y, Xdyad = YX_nrm$X,
                             n_chains = 2, cores = 1,
                             nscan = 100, burn = 10, odens = 1,
                             verbose = FALSE)
# }