Learn R Programming

lame (version 1.3.4)

ame_parallel: Run AME model with multiple parallel chains

Description

Run AME model with multiple parallel chains

Usage

ame_parallel(
  Y,
  n_chains = 4,
  cores = n_chains,
  combine_method = c("pool", "list"),
  fitter = c("auto", "ame", "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

Arguments

Y

Network data matrix

n_chains

Number of parallel chains to run (default = 4)

cores

Number of CPU cores to use for parallel processing. 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().

Author

Cassy Dorff, Shahryar Minhas, Tosin Salau

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.

Examples

Run this code
# \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)
# }

Run the code above in your browser using DataLab