Skip to contents

An MCMC routine providing a fit to an additive and multiplicative effects (AME) regression model to longitudinal (time-series) relational data of various types. Supports both unipartite (square) and bipartite (rectangular) network structures. For cross-sectional (single time point) networks, use the ame function.

Usage

lame(
  Y,
  Xdyad = NULL,
  Xrow = NULL,
  Xcol = NULL,
  rvar = TRUE,
  cvar = TRUE,
  dcor = !symmetric,
  nvar = TRUE,
  R = 0,
  R_row = NULL,
  R_col = NULL,
  mode = c("unipartite", "bipartite"),
  dynamic_uv = FALSE,
  dynamic_ab = FALSE,
  dynamic_beta = FALSE,
  dynamic_rho = FALSE,
  dynamic_beta_kind = c("ar1", "rw1", "rw2", "matern32"),
  dynamic_uv_kind = c("ar1", "snap", "t"),
  family = "normal",
  intercept = !(family == "ordinal"),
  symmetric = FALSE,
  prior = list(),
  g = NA,
  seed = 6886,
  nscan = 10000,
  burn = 500,
  odens = 25,
  plot = FALSE,
  verbose = FALSE,
  gof = TRUE,
  start_vals = NULL,
  periodic_save = FALSE,
  out_file = NULL,
  save_interval = 0.25,
  model.name = NULL,
  save_log_lik = FALSE,
  posterior_opts = NULL,
  log_lik_path = NULL,
  log_lik_chunk_size = 10000L,
  keep_snap_draws = c("none", "summary", "draws"),
  freeze_call = FALSE,
  dynamic_beta_pool = c("none", "rho", "sigma", "both"),
  dynamic_beta_per_actor = NULL,
  per_actor_covariate_idx = 1L,
  per_actor_identifiability = c("center", "exact_center"),
  keep_per_actor = c("auto", "draws", "summary", "none"),
  time_index = NULL,
  period_exposure = NULL,
  max_seconds = Inf,
  checkpoint_path = NULL,
  checkpoint_every = 100L,
  log_lik_method = c("observed_exact", "observed_approx", "augmented"),
  ordinal_cutpoints = c("data_induced", "explicit"),
  method = c("mcmc", "als"),
  als_stability = c("none", "quick", "validation"),
  als_max_iter = 1000L,
  als_tol = NULL,
  als_lowrank_method = NULL,
  als_linear_solver = NULL,
  als_multistart = NULL,
  multistart = c("none", "cheap", "full"),
  bootstrap = 0L,
  bootstrap_type = c("parametric", "block"),
  bootstrap_block_length = 1L,
  bootstrap_seed = NULL,
  chains = .lame_chains_default(),
  cores = NULL,
  resume_from = NULL,
  sampler = c("gibbs", "tempered")
)

Arguments

Y

a T length list of relational matrices, or a 3D array of dimensions [n_row, n_col, T], where T is the number of time periods. Named lists may have changing actor composition; actors are aligned by row and column names. A longitudinal netify object is also accepted and converted with netify::to_lame(lame = TRUE). When family or mode is omitted, the value inferred by netify is used. See family below for data types.

Xdyad

a T length list of n x n x pd arrays of covariates. A lagged-tie covariate absorbs latent structure the model does not capture (moving positions fitted as static or not at all, or a multiplicative term too weak to be recovered on a sparse network), which biases the same-direction lag coefficient upward on both routes, more on the fast route.

Xrow

a T length list of n x pr matrices of nodal row covariates. In a symmetric model (symmetric = TRUE) each node covariate enters a dyad through both of its actors.

Xcol

a T length list of n x pc matrices of nodal column covariates. In a symmetric model a node covariate may be given in Xrow, in Xcol or in both, and each distinct covariate enters once, as <name>_node.

rvar

logical: fit row random effects (asymmetric case)? With method = "als" and a normal, binary or Poisson dynamic fit by the empirical-Bayes estimator, rvar, cvar, nvar and dcor are honoured (a disabled margin is a point mass at zero, as in the sampler; see dcor for the correlation); the penalised routes name them in the warning about ignored arguments.

cvar

logical: fit column random effects (asymmetric case)? See rvar for method = "als".

dcor

logical: fit a dyadic correlation (asymmetric case)? The correlation \(\rho\) of the two residuals of a dyad carries a flat prior on \((-1, 1)\). Information about it depends on joint presence and absence of ties and the fitted means. With fewer than one mutual dyad per period, or fewer than 30 in all, the data inform it mainly through the absence of mutual ties, and a message gives the count. Its posterior can then stay near the prior or move well away from it: toward -1 when the fitted means predict more mutual ties than the panel has (on the 40-state MID panel, -0.58 with 95 percent interval -0.92 to -0.13). The additive effects, coefficients and latent positions all retain the same sampled correlation, including on panels with few mutual dyads. dynamic_uv = TRUE keeps the correlation: the per-period position kernel whitens each dyad's pair of residuals by the current \(\rho\), exactly as the static-position kernel does, so the reciprocity is carried by \(\rho\) instead of being absorbed into the coordinates. A period-varying \(\rho\) (dynamic_rho) needs static positions. A Poisson residual variance below 0.1 leaves \(\rho\) to its prior in the same way, and a message says so. An exactly symmetric Y fitted with symmetric = FALSE has equal reciprocal residuals, so the posterior of \(\rho\) concentrates near one (with dcor = FALSE the two cells of a dyad count as two observations); a message says so and points at symmetric = TRUE, which fits the undirected model. A normal model with dcor = TRUE has no proper posterior once the reciprocal pairs of the panel outnumber what its mean parameters absorb by two (the bound ame applies, pooled over the periods: they share \(\rho\), so the excess of every period adds, and a parameter they share absorbs its contrasts once): \(\rho\) runs to one, with static or dynamic positions or none, and the variance draw breaks down. Such a fit is an error of class lame_symmetric_y. With method = "als" a directed binary fit (the probit link of the empirical-Bayes default) models the correlation: the two cells of a dyad are one bivariate probit observation, the correlation is one number for all periods (fit$VC["rho"]; the record, with its standard deviation, in fit$rho_estimation and fit$eb$pair), and it is estimated with the other hyperparameters under the prior above. A directed Poisson fit takes the two counts of a dyad as one observation at the fitted state of independent cells: the correlation is the posterior mean, under the same prior, of the profile of the pair probability, and the information of the pairs enters the standard errors. A directed normal fit takes the two cells of a dyad as one bivariate normal observation, in closed form, and estimates the correlation under the same prior; a directed network whose reciprocal pairs are all exactly equal is an error of class "lame_improper_normal_reciprocity", as in ame (fit it with symmetric = TRUE or dcor = FALSE). dcor = FALSE fits independent cells. Undirected and bipartite networks have no pair of cells. On the dynamic route the pair of cells of a binary fit is integrated over the uncertainty of its latent factors or moving positions, and the fit takes 1.4 to 2.7 times as long as the independent-cell fit (1.4 with additive effects only, 1.9 to 2.7 with static factors or moving positions); options(lame.als_threads) splits the work over threads and changes nothing else.

nvar

logical: fit nodal random effects (symmetric case)? See rvar for method = "als".

R

integer: dimension of the multiplicative effects (can be zero). A binary fit whose multiplicative term reproduces the observed ties exactly is separated: the size of the term is then set by its prior, the fit says so, and the signs and the fitted probabilities are what the data determine; a smaller R (down to zero for a panel whose ties barely change over time) reproduces them without saturating. With method = "als" and dynamic_uv = FALSE, the latent factors of a normal, binary or Poisson dynamic fit are static and have the variational posterior of the static estimator (ame_als): their posterior means are reported as U and V, the scale of their prior in fit$eb$factor_prior, and the standard errors are marginal over the factors and carry the uncertainty of that scale (fit$eb$factor_scale$sd_log; options(lame.eb_scale_uncertainty = FALSE) leaves it out).

R_row

integer: for bipartite networks, dimension of row node multiplicative effects (defaults to R)

R_col

integer: for bipartite networks, dimension of column node multiplicative effects (defaults to R)

mode

character: either "unipartite" (default) for square networks or "bipartite" for rectangular networks

dynamic_uv

logical: fit dynamic multiplicative effects (latent factors). The transition model is selected by dynamic_uv_kind. A directed fit with dynamic positions carries the dyadic correlation of dcor through the position kernel (see dcor). fit$U / fit$V hold the positions factored from each period's posterior mean product (see latent_positions); the per-iteration cubes are kept as fit$U_draws / fit$V_draws by the default posterior_opts (or with posterior_opts = list(save_UV_draws = TRUE)), and give the posterior standard deviations. Default FALSE. With method = "als" and a normal, binary or Poisson outcome the positions are estimated by the dynamic empirical-Bayes estimator: fit$U and fit$V are the posterior means (n x R x T) with posterior standard deviations fit$U_sd and fit$V_sd, fit$Oarr (alias fit$UVPM) is the posterior-mean product, and fit$eb$uv_dynamics holds the persistence, innovation sd and stationary variance of the positions' AR(1) law with the search over the stationary variance, the signal statistic (the product signal per loading in units of its weak-product threshold), its threshold (2) and estimated: the values are estimates under the lame() hyperprior when estimated is TRUE, and working values of the fast route's search otherwise (als_start_vals() starts the sampler at them either way); use method = "mcmc" to estimate them when the data carry too little signal. Directed, bipartite (R_row and R_col may differ: the interaction has rank min(R_row, R_col)) and undirected networks are covered.

dynamic_ab

logical: fit dynamic additive effects (sender/receiver effects) that evolve over time. When TRUE, the row effects (a) and column effects (b) become time-varying as a per-actor level plus an AR(1) deviation (see the model description in the details). This captures temporal heterogeneity in actors' baseline propensities to send and receive ties, allowing for smooth changes in activity levels and popularity over time. For example, an actor's tendency to form outgoing ties might gradually increase or decrease across observation periods. The AR(1) specification ensures temporal smoothness while allowing for actor-specific evolution patterns. Implementation uses conjugate updates where possible and C++ for computational efficiency. Default FALSE. With an intercept (every family but ordinal), dynamic_ab = TRUE also makes the intercept a dynamic coefficient, a random-walk path over the periods that summary() reports with the coefficient paths. Each dynamic effect is a per-actor level plus a zero-mean AR(1) deviation: the level is pooled over every period (its variance is the reported va / vb) and the deviation carries the persistence rho_ab and innovation scale sigma_ab. The marginal variance of a per-period effect is therefore va + sigma_ab^2 / (1 - rho_ab^2), and rho_ab describes the deviations, so on short panels it reads lower than the persistence of the raw effect path. Both parts are drawn from the likelihood: the levels given the deviations and the deviations given the levels, so persistent actor heterogeneity lives in the effects. The regression coefficients are drawn conditional on the current effects, and the effects are drawn conditional on summing to zero in every period when an intercept is included. Under that constraint an individual actor's marginal variance has the additional factor 1 - 1/n, where n is the number of actors in that margin.

Because the effects of every period sum to zero, a static intercept would leave no room for a shift common to all actors in one period (the whole network busier in period t), which the data identify. With an intercept the intercept is therefore a dynamic_beta coefficient whenever dynamic_ab = TRUE: it is added to the coefficients that dynamic_beta names, and dynamic_beta = FALSE gives a dynamic intercept alone (its own block). The added intercept is a random walk ("rw1") when dynamic_beta_kind is "ar1", so its forecasts hold the last level of the network. Blocks the user names keep dynamic_beta_kind; with "rw1", "rw2" or "matern32" the intercept takes that kind. fit$dynamic_beta_kind_by_block gives the kind of each block, and an "rw1" block holds RHO_BETA = 1. BETA is then an iterations x coefficients x periods array, and fit$dynamic_intercept_from_ab records that the rule added the intercept. The rule applies with dynamic_rho = TRUE, whose coefficient paths are filtered under each period's \(\rho_t\), and with the tempered sampler, which carries the random-walk intercept in its replica state.

The reported intercept and effects are the identified quantities when the fit has a multiplicative term; see the details.

A directed binary panel carrying fewer than 1.2 events per actor-period (two periods or more) reports va and vb as not estimated, and fewer than 0.6 (1.6 with a multiplicative term) its intercept. On simulated panels of 30 actors and 5 periods (static and dynamic effects, ranks 0 and 1, 64 to 252 panels a rate bin) the 95 percent intervals of va and vb covered 0.31 and 0.28 of the panels below 0.6 events per actor-period, 0.73 and 0.68 from 0.6 to 0.9, 0.91 and 0.81 from 0.9 to 1.2, and 0.91 to 1.00 from 1.2; the intercept covered 0.57 to 0.87 of the panels below its rate and 0.92 or more from it. The persistence rho_ab (coverage 1.00 at every rate) and the innovation scale sigma_ab (0.84 to 1.00) are reported at every rate, and so is cab (0.97 to 1.00). The draws remain in fit$VC and fit$BETA; fit$events_per_actor_period and fit$events_per_actor record the event rates. Supplying an effects prior (prior$Sab0, eta0 or etaab) reports va and vb under that explicit prior, which the summary names. Count families keep reporting their variance components. The stored paths a_dynamic and b_dynamic contain the full level-plus-deviation effects. Static latent positions are centered for reporting, with the removed product components carried by the reported intercept and effects. Dynamic latent coordinates retain the coordinates drawn under their proper path prior. Compare fitted predictors and per-period products across chains; raw coordinates can differ through latent rotations.

dynamic_beta

logical, character, integer, or logical-vector flag selecting which regression coefficients evolve over time via independent AR(1) processes. Default FALSE keeps every coefficient static (the historical behaviour). Accepted forms:

  • FALSE / NULL: no coefficient is dynamic.

  • TRUE: every coefficient is dynamic.

  • character vector of block shortcuts ("intercept", "dyad", "row", "col") or specific coefficient names from colnames(BETA) – those become dynamic.

  • integer vector: 1-based column indices into colnames(BETA).

  • logical vector of length p: per-coefficient mask.

Each dynamic-coefficient block (one per distinct intercept / dyad / row / col label that has at least one dynamic coefficient) gets its own AR(1) parameters \(\rho_\beta\) (truncated-Normal prior, default mean 0.8, bounded between 0 and 0.999) and \(\sigma_\beta^2\) (inverse-Gamma prior, default shape 2 with a scale set from the response scale, see prior). The joint posterior over the time path \(\beta_t\) is drawn by Forward-Filter / Backward-Sample (FFBS) inside the MCMC loop, conditional on the current static-block beta and on (a, b, U, V). When the intercept or a nodal coefficient is dynamic, a sum-to-zero contrast basis is applied to the additive-effect sampler to keep \(a_i + intercept_t\) identified. Requires at least 2 time periods. dynamic_beta composes with multiplicative latent factors (R > 0) and additive random effects for every family, across unipartite/bipartite and directed/symmetric panels and in combination with dynamic_ab / dynamic_uv. An AR(1) coefficient reverts to its own long-run mean \(\mu_k\): $$\beta_{k,t} - \mu_k = \rho_\beta (\beta_{k,t-1} - \mu_k) + e_{k,t}, \quad e_{k,t} \sim N(0, \sigma_\beta^2 \lambda_k),$$ with the first period drawn from the stationary law \(N(\mu_k, \sigma_\beta^2 \lambda_k / (1 - \rho_\beta^2))\), where \(\lambda_k\) is the innovation scale of the coefficient (one over the mean square of its covariate). \(\mu_k\) has the prior the coefficient has when static (see g): in a unipartite fit the marginal of the panel prior on its column, with precision from sum_t(crossprod(X_t)) / (T g) and free of \(s^2\); in a bipartite fit \(N(0, g_k s^2)\) with \(g_k\) the default g over the mean square of the covariate column (g itself for the intercept or a user-supplied g) and \(s^2\) the dyadic variance (one for the probit and rank families). It is drawn from its Gaussian conditional given the path and \((\rho_\beta, \sigma_\beta)\); the path is drawn given \(\mu_k\). \(\rho_\beta\) is therefore the persistence of the coefficient's movement around its level, and an \(h\)-step forecast of the coefficient reverts to \(\mu_k\) as \(\rho_\beta^h\). The long-run means are fit$mu_beta (posterior means) and fit$MU_BETA (draws, one column per AR(1) coefficient); print(), summary(), confint(fit, parm = "mu_beta") and trace_plot() report them and the convergence checks monitor them. Random-walk ("rw1"), "rw2" and "matern32" paths have no long-run mean. An "rw2" or "matern32" path is its first-period level, with the prior of a static coefficient, plus its change since then: under "rw2" the first increment is \(N(0, \sigma_\beta^2 \lambda_k)\) and so is each second difference; under "matern32" the change is that of a Matern 3/2 process with variance \(\sigma_\beta^2 \lambda_k\) and length scale prior$matern32_length_scale (default \(\max(2, T/4)\)). The tempered sampler carries the same laws, and an \(h\)-step forecast draws the future periods from their conditional given the fitted ones. With a single dynamic coefficient block and small \(T\), only \(T - 1\) transitions inform its AR(1) persistence, so the data inform \(\rho_\beta\) weakly and its posterior stays near the prior; the path BETA[, k, ] is read separately from the hyperparameters, and dynamic_beta_prior_summary shows the paths the prior implies. The hyperparameters of each block (\(\rho_\beta\) and \(\sigma_\beta\), and the pooled scale and persistence of dynamic_beta_pool) are drawn from their exact conditionals given the path at every sweep (a draw costs well under a millisecond). Earlier versions drew them every 20th sweep; on normal and binary panels that left the scale and the persistence with 4 to 20 times fewer effective draws (panels of 5 to 170 actors; at 170 actors 357 of 1,600 draws of the scale on a normal panel and 304 on a binary one, where every sweep gives 1,599 and 1,335). An interweaving step also moves the hyperparameters together with the path, before the path is redrawn given them. It proposes new values of \((\sigma_\beta, \rho_\beta)\) by a symmetric walk on \((\log \sigma_\beta, \mathrm{logit}\,\rho_\beta)\), rebuilds the path from the same standardised innovations (the state equation divided by the innovation scale; "rw2" and "matern32": the first period stays fixed and the change since then scales with \(\sigma_\beta\), the length scale being fixed) and accepts with the Metropolis ratio of the likelihood of the rebuilt path and the hyperprior (the pooled hierarchies included). It targets the funnel of hierarchical models: where the data say little about the path (few actors, many periods) and the prior of the scale is diffuse, the centred draws alone move the scale slowly, because the scale given the path is pinned at the spread of the path in hand. On a panel of six actors and 30 periods with prior$sigma_beta_shape = 0.5 and prior$sigma_beta_scale = 1e-4 the step raised the effective draws of the scale 2.8 times and those of the persistence 2.0 times over the draws at every sweep; at the default prior it raised them 1.0 to 1.5 times on the panels checked (5 to 30 actors, 12 to 60 periods), which about repays the time it takes there (10 to 60 percent of a sweep). Where the data pin the path (a dense panel) about nine proposals in ten are rejected and the step costs 3 percent of a sweep at 170 actors. prior$beta_hyper_nc = FALSE omits the step, and fit$beta_hyper_move records its attempts and accepts. With method = "als", selected intercept, dyadic, row-node, and column-node coefficients are supported on normal, binary, and Poisson panels, including named panels where actors enter or exit. Dynamic ALS uses period-specific Xrow or Xcol values for selected dynamic node coefficients; static node coefficients still use per-actor means. The ALS estimator fits the same long-run means (fit$mu_beta), as random effects under the static coefficient prior, with Laplace standard errors in fit$eb$mu_beta_se. Dynamic intercepts are unavailable when family = "ordinal". Default FALSE.

dynamic_rho

logical. For directed unipartite normal models, allow the residual dyadic reciprocity parameter \(\rho_t\) to vary by period instead of using one pooled dyadic correlation across the whole panel. It requires static latent positions (dynamic_uv = FALSE) and combines with dynamic_beta, whose paths are filtered under each period's \(\rho_t\). MCMC fits store per-draw paths in fit$RHO and the posterior mean path in fit$rho_path. This option is not supported with method = "als"; use a supported MCMC configuration for period-specific reciprocity. Dynamic ALS fits use one pooled correlation, fit$VC["rho"], and report period-specific residual diagnostics in fit$residual_rho_path. The legacy fit$rho_path field remains a diagnostic alias, labelled by fit$rho_path_role = "residual_diagnostic"; it is not a fitted covariance path. als_start_vals() uses the pooled ALS correlation, including for legacy ALS objects. Default FALSE.

dynamic_beta_kind

character: state-space prior on the dynamic coefficient block(s). "ar1" (default) gives mean-reverting AR(1) with a truncated-Normal prior on \(\rho_\beta\). "rw1" gives a random walk (\(\rho_\beta\) pinned at 1, no truncation), appropriate when you expect permanent drift with no mean reversion – e.g. trade-gravity coefficients in a permanently changing world economy. The alias "random_walk" is also accepted for "rw1". When the stationarity warning in summary(fit) fires under the default AR(1), refit with dynamic_beta_kind = "rw1" for cleaner inference. Decision tree: mean-reverting? AR(1). Permanent / unit-root drift? RW1. Smooth with curvature? "rw2" (second-order random walk). Smooth with a known length-scale? "matern32" (Matern 3/2). Note: "rw2" and "matern32" use an R-level joint Gaussian sampler and run substantially slower per iteration than the C++ FFBS used for "ar1" / "rw1" (roughly 2-4x on n = 100, T = 10). On method = "als" the coefficient paths are "ar1", "rw1" or "rw2", including the empirical-Bayes estimator; "matern32" is refused there and needs method = "mcmc".

dynamic_uv_kind

Character string selecting the transition model for dynamic multiplicative latent positions when dynamic_uv = TRUE. "ar1" uses Gaussian AR(1) drift, "snap" uses a mixture of AR(1) drift and discontinuous reset transitions, and "t" uses heavy-tailed Student-t innovations represented by local transition scales, with (in the MCMC sampler) a Student-t first period of the same degrees of freedom and the stationary scale (see Details). On the MCMC path, "snap" is available for directed, bipartite and symmetric fits and "t" for directed unipartite fits, at any rank (the symmetric product's unit-variance coordinates do not hold their scale under the scale-mixture transitions). A bipartite snap fit carries the resets of its row and of its column actors, each with its own paths, under one persistence, innovation scale and reset rate; a symmetric one carries one set of unit-variance paths, so its linked reset scale is 1. Under "snap", a reset lands on the stationary distribution of the position paths unless prior$snap_kappa fixes its scale, and rho_uv and sigma_uv are updated jointly with the latent reset indicators. Each actor's whole path is also drawn with its resets summed out (prior$actor_move_paths, see Details), so a period change can pass between a reset and a drift explanation. At every rank, summary(), print() and trace_plot() report rho_uv, sigma_uv and the reset rate pi_snap of a "snap" fit, and the two-chain check monitors them; at rank two or more the exact rotation move (prior$uv_rotation_move) keeps the orientations of the periods of a directed fit aligned, and bipartite and symmetric fits draw their own gauge given the resets. They report rho_uv and sigma_uv of a "t" fit at every rank too, and the check monitors them. A "t" chain starts from a dynamic ALS fit by default (prior$als_start); that is a warm start only, and a chain started cold reports and monitors them the same way. Both kinds receive conditional sign updates that preserve the fitted products and help chains explore alternative trajectory orientations. With method = "als", "snap" is refused. The ALS "t" kind supports directed and symmetric normal, binary and Poisson panels; bipartite Student ALS is refused. A normal, binary or Poisson fit is fitted by the dynamic empirical-Bayes estimator for "ar1" (Gaussian) and "t" transitions (directed and undirected networks): the weights of the scale mixture have a variational posterior, and the degrees of freedom are prior$t_nu (default 4). ALS Student-t dynamic UV fits attach the final local transition-weight matrices as fit$lambda_u and fit$lambda_v (n x T, one in the first period).

family

character: one of "normal","binary","ordinal","poisson" - see the details below

intercept

logical: fit model with an intercept?

symmetric

logical: is the sociomatrix symmetric? A symmetric fit needs a symmetric Y in every period and symmetric Xdyad slices, as in ame: the regression term of a symmetric fit is symmetric, so an asymmetric slice is an error (class lame_symmetric_xdyad) that names the slice and the first period; so is it with method = "als". Replace it by (X + t(X)) / 2. A value missing in one triangle of a slice is not an asymmetry: it is filled from the other triangle.

prior

a list containing hyperparameters for the prior distributions. Available options and their defaults:

s20

Fixed positive prior scale for the dyadic residual variance \(v_e\). The prior has one degree of freedom. By default, normal fits use the variance of the observed responses, computed once before sampling; constant responses use their mean square, or 1 if all zero. Poisson fits use 1 on the latent log-rate scale. The resolved scale is reported as fit$s2_prior_scale. It is never recomputed from the current residuals. A supplied value overrides this default. The coefficient prior is controlled separately by g.

uv_prior

For sampler = "tempered", "hierarchical" (default) or the explicitly different "unit" coordinate prior. This option is refused on the Gibbs route. See Details.

Sab0

Prior scale matrix for the additive-effects covariance. A 2x2 matrix where Sab0\[1,1\] is the prior variance for row effects, Sab0\[2,2\] is the prior variance for column effects, and off-diagonals control correlation between row and column effects. For the "normal" and "poisson" families, and for unipartite "binary" and "ordinal", this defaults to diag(2) scaled to the observed sender/receiver heterogeneity in Y (for the ordinal family, of its probit-moment scores) rather than to a fixed diag(2); see ame for the rationale. Bipartite fits of the probit-scale families use diag(2). Pass diag(2) explicitly for a fixed unit-scale prior.

eta0

Prior degrees of freedom for the additive-effects covariance \(\Sigma_{ab}\) (default: round(4 \* vdfmlt) for unipartite "binary" and "ordinal" fits, where vdfmlt is a probit-moment variance multiplier estimated from Y, and round(4 + 3 \* n/100) otherwise, where n is the number of actors; 1 for a "poisson" fit, whose default Sab0 is the effects covariance the fast route (lame_als) estimates for the same panel, or the log-rate scale where that fit fails; see ame). Higher values impose stronger shrinkage of the row/column effects toward the prior scale. The multiplicative-effects static unipartite prior is the one of ame: an inverse-Wishart covariance with the degrees of freedom and the data-scaled Suv0 of kappa0 and Suv0 in ame, read off every period of the panel (the static factors are shared by the periods). Suv0 and kappa0 apply to ame of a unipartite network only; a bipartite network has no such covariance, and supplying either is an error of class "lame_prior_unused".

etaab

Prior degrees of freedom for covariance of additive effects (default: 4 + 3 \* n/100). Controls shrinkage of row/column random effects.

ab_min_observed

Observation count used to shrink sparse actor initial values (default: max(10, T)). Subsequent actor updates use the specified Gaussian prior without deterministic shrinkage.

rho_uv_mean

For dynamic_uv=TRUE: Prior mean of the persistence \(\rho_{uv}\) of the latent positions, a normal prior truncated to (-0.99, 0.99). Default 0.7 on the MCMC path for every family, kind and mode (the dynamic ALS estimator keeps 0.5 for Gaussian bipartite AR(1) fits and 0.9 otherwise). Values close to 1 indicate high persistence.

rho_uv_sd

For dynamic_uv=TRUE: Prior SD of \(\rho_{uv}\). Default 0.3 on the MCMC path (the ALS estimator keeps 0.2 and 0.1). A setting of either is used as given and the other keeps its default, so a fit that sets both is unchanged by the default. The data see \(|\rho_{uv}|\) only (see uv_rho_flip_move) and the draws are stored with \(\rho_{uv} \ge 0\), so the prior acts through its mass folded onto [0, 0.99). The default comes from a simulation study (AR(1) positions at rank two, 20 and 40 actors, 4, 6 and 10 periods, true persistence 0.3, 0.6 and 0.9, normal, binary and Poisson responses, the three kinds and the three modes; 522 panels, the posterior under each candidate prior reweighted from one fit under a nearly flat prior). Under the former default N(0.9, 0.1) the 90 percent intervals covered a true 0.3, 0.6 and 0.9 in 11, 51 and 82 percent of the panels (mean standardised bias +5.3, +1.6 and -0.2 posterior sd); under N(0.7, 0.3) they cover in 90, 88 and 80 percent (+0.36, +0.22 and -0.22). Flatter priors (N(0.5, 0.5), a uniform, a Beta(9, 2) on \((\rho + 1)/2\)) did no better and priors whose sd shrinks with the Fisher information of the panel did worse; the former Gaussian bipartite N(0.5, 0.2) pulled a persistence of 0.9 down without helping at 0.3. The low coverage of a true 0.9 in binary and Poisson panels that this study left came from the prior on the innovation variance (see uv_var_shape). Under the "t" kind, whose first period has the tail of its transitions, directed panels of Gaussian AR(1) paths (20 actors, 6 periods, 24 panels per family and persistence) are covered in 85, 86 and 86 percent at a true 0.3, 0.6 and 0.9 (mean standardised bias +0.50, -0.18 and +0.13); with a Gaussian first period and the inverse gamma on \(\sigma_{uv}^2\) they were covered in 79, 92 and 68 percent (+0.68, +0.18 and +0.20). Directed Poisson panels at a true 0.3 are the low cell: on the 24 panels of that study (20 actors, 6 periods) the "t" kind covers 67 percent (+1.24) and "ar1" 75 percent (+0.92). The panels' own paths place the persistence +0.25 sd above the average panel and the prior adds +0.4 sd (a nearly flat prior gives +0.85), and the heavy-tailed transitions read the estimation noise of weakly identified count positions as innovations: \(\rho_{uv}\) sits 0.031 higher than under "ar1" on the same panels (0.002 with prior$t_nu = 50, 0.045 over 12 periods, where the "t" kind covers 75 percent at +1.10 against "ar1"'s 75 percent at +0.31, and 0.010 with 40 actors, where it covers 83 percent at +0.33). On Poisson panels whose paths have Student-t transitions, the kind's own model, it covers a true 0.3 in 92 percent of 24 panels at 6 periods (+0.14) and in all 12 at 12 periods (-0.11).

uv_var_shape

For dynamic_uv=TRUE: shape of the inverse-gamma prior on the stationary variance \(w = \sigma_{uv}^2 / (1 - \rho_{uv}^2)\) of a latent coordinate path, independent of \(\rho_{uv}\) (default 2). Given \(\rho_{uv}\) it is the inverse gamma with scale uv_var_scale \(\times (1 - \rho_{uv}^2)\) on the innovation variance, so the innovations shrink with the persistence. It is the default unless sigma_uv_shape or sigma_uv_scale is set; setting both kinds is an error. The default comes from a simulation study (AR(1) positions at rank two, directed and bipartite, normal, binary and Poisson, 20 actors over 4 and 10 periods and 40 actors over 4, true persistence 0.3, 0.6 and 0.9, and the "t" and "snap" kinds on directed binary and Poisson panels; 336 panels, every candidate reweighted from one fit under a nearly flat prior). The former default, an inverse gamma IG(2, b) on \(\sigma_{uv}^2\), pulls a persistent path toward a lower \(\rho_{uv}\): given the stationary variance, which the data fix, its density in \(\rho_{uv}\) falls as \(\exp(-b / (w (1 - \rho_{uv}^2)))\). Its 90 percent intervals covered a true 0.9 in 76 percent of the panels (mean standardised bias -0.84 posterior sd; 62 percent and -1.7 for directed Poisson panels, 75 percent and -0.9 for binary ones), and removing or halving uv_var_cap changed nothing, since the stationary variance never came near it. Under the default the intervals cover a true 0.3, 0.6 and 0.9 in 96, 90 and 86 percent of the panels (+0.23, +0.16 and -0.18), directed binary 0.9 in 92 percent and directed Poisson 0.9 in 85 percent of the AR(1) and snap panels (+0.16). Inverse gammas of shape 1, 1.5 and 3, scales from 0.1 b to 2 b, half-t and flat priors on \(w\) did as well within Monte Carlo error, and a scale of b / 2 gave the best coverage of directed Poisson panels; inverse gammas on \(\sigma_{uv}^2\) with smaller scales or a half-Cauchy on \(\sigma_{uv}\) moved the persistence at 0.3 and 0.6 up by about 0.1 posterior sd. With this prior the posterior allows the small innovation variances of persistent paths, which the conditional draws of the paths and of \((\rho_{uv}, w)\) cross slowly, so directed and bipartite fits of the "ar1" kind also take a non-centred update of \((\rho_{uv}, w)\) with the whitened innovations held fixed, binary and Poisson fits also with the latent array carried along the product (fit$uv_nc_hyper_move). On the release sweep's dynamic positions cells the two-chain check then extends the chains as often as under the former prior (1.22 against 1.23 extensions a fit over 144 fits, none refused).

uv_var_scale

For dynamic_uv=TRUE: scale of that prior. Default b / 2, where b is 1 and, for the normal family of a directed unipartite network, the typical size of the additive effects (the scale of the factor prior above), so the prior is the same for a response measured in other units; the positions of a bipartite or undirected network are unit free, the interaction matrix and the weights carrying the unit. Symmetric fits draw neither variance: their coordinate paths have unit stationary variance, so the innovation SD is \(\sqrt{1 - \rho_{uv}^2}\) and the diagonal L of the product carries the scale.

sigma_uv_shape

For dynamic_uv=TRUE: shape of an inverse-gamma prior on the innovation variance \(\sigma_{uv}^2\) itself, used instead of the stationary-variance prior when this or sigma_uv_scale is set (the other then defaults to 2 for the shape and to b for the scale). Fits and checkpoints written with these settings, including those of lame 1.4.1 and earlier, whose default this was, are unchanged.

sigma_uv_scale

For dynamic_uv=TRUE: scale of that inverse-gamma prior on \(\sigma_{uv}^2\).

uv_max_abs

For dynamic_uv=TRUE: absolute bound on each free latent coordinate. Each actor-vector conditional rejects proposals outside this joint prior support. Default 8 for the binary and ordinal families and 50 for normal and Poisson families (the bound of a unipartite normal fit is multiplied by the square root of sd(Y): its coordinates carry the square root of the unit of the response). Set to Inf to remove the restriction. A finite bound changes the prior; no deterministic coordinate normalization is applied. The box is part of the prior on the scale of the positions, which the data do not fix in a bipartite fit (the interaction matrix carries it) and which uv_var_cap already limits: on the validation panels (50 actors, 5 periods; bipartite 40 by 30) the largest coordinate drawn under the default box was 7.8 (the box is 8 on the probit scale) and 6.9 with the box removed, a proposal fell outside it in at most 1 of 10000 sweeps, and the coefficients, variance components, fitted values and posterior mean of the product \(U G V'\) with and without the box differed by about as much as two chains of the same fit do (at most 0.0014 root-mean-square for the product, and none for the Poisson panels, where no proposal came near the box). It matters when a fit separates the data: without it the product runs away.

G_max

For bipartite fits with a static interaction matrix: absolute bound on entries of \(G\). A joint Gaussian conditional proposal outside the bound is rejected. Default 20 for the binary and ordinal families with dynamic_uv=TRUE and 100 otherwise (multiplied by sd(Y) for the normal family: the interaction matrix carries the unit of the response). Set to Inf to remove this prior restriction. On the validation panels the largest entry drawn was 2.7, a tenth of the default bound, and no proposal fell outside it.

sigma_uv_max

For dynamic_uv=TRUE: rail on the innovation SD of the latent coordinate paths. Default 10 for bipartite fits, where \(G\) absorbs the scale, and none for unipartite fits. On the validation panels the posterior of the innovation SD stayed below 1.4, a seventh of the rail.

uv_var_cap

For dynamic_uv=TRUE: bound on the stationary variance of a latent coordinate path. This is joint prior support for sigma_uv and rho_uv; both updates respect it. A finite cap also constrains the residual-variance update for normal responses. The bound is a multiple of the observation variance for the normal family and absolute on the latent scale otherwise: the binary and ordinal families fix that variance at one, and for the Poisson family the latent scale is the log rate, whose overdispersion variance does not enter. Default 4 for the binary, Poisson and ordinal families and Inf for the normal family. In a bipartite fit the interaction matrix carries the scale of the paths and the data do not identify it, so the posterior of the stationary variance lies against this bound (within 10 percent of the default in 29 percent of the sweeps of the validation panel, against none in the unipartite ones; without the bound its 1st to 99th percentiles run from 3 to 76). Between a cap of 4, a cap of 16 and none the coefficients and the variance components of the validation fit moved by at most 1.2 percent, while rho_uv, sigma_uv and the norms of U and V follow the cap: read a bipartite fit through the product \(U G V'\), not through its factors. For the binary and ordinal families uv_max_abs also defaults to 8 and G_max to 20 rather than 50 and 100, so that once a fit separates the data the product \(U G V'\) is bounded on the latent scale instead of running away.

uv_temper_move

Logical, default TRUE. For symmetric Poisson fits with dynamic_uv of the "ar1" kind: every uv_temper_every sweeps (a positive whole number, default 5; a fit with the transition and the uv_nc_move step costs 1.4 times one without them) make a tempered transition (Neal 1996) of one randomly chosen eigen-direction (its weight and coordinate paths, the latent array carried with the predictor), which crosses between the signatures of the weights that the other draws cross only in thousands of sweeps. Recorded in fit$uv_temper_move.

uv_nc_move

Logical, default TRUE. For dynamic_uv of the "ar1" and "snap" kinds: in symmetric fits, draw the persistence rho_uv given the standardised innovations of the paths (the paths then follow the new persistence; a snap reset position, which does not involve it, is held), and in bipartite fits draw the factor by which the paths, the innovation scale sigma_uv and the interaction matrix trade scale at no cost to the predictor (under "snap" with a fixed prior$snap_kappa, the reset positions add their prior ratio). The conditional draws cross these directions slowly (30 to 70 effective draws of 400 for the persistence of a 50-actor symmetric panel). FALSE omits them.

cov_ridge_move

Logical, default TRUE. For directed fits with a row or column covariate (a design slice constant along the columns or the rows) and static coefficients: each sweep also draws, exactly, the amount by which the coefficient and the additive effects of that margin (the levels and, with dynamic_ab, the deviation paths; the intercept takes the constant of the centring) trade against one another without changing any cell's predictor, up to a constant of each period that the latent array absorbs. The conditional draws cross this ridge slowly (the coefficient of a period-varying nodal covariate had 38 to 99 effective draws of 800 on a 170-actor ordinal panel). FALSE omits it.

sparse_position_move

For directed "ordinal" fits with latent factors (R > 0, not dynamic_uv): each sweep also draws the position of every sender and receiver together with the latent values of its row or column, exactly. Moving \(u_i\) changes the predictor of row \(i\) by a different amount in each column; carrying the latent values along changes no residual, so the conditional of the position is its prior times the indicator that the shifted row is still a latent row the data allow, drawn by an elliptical slice step. Actors the data bound on one side only (only the lowest category) move across their wide posterior in a few sweeps instead of by random walk. Recorded in fit$sparse_position_move. An ordinal fit that runs it visits the level translations of actor_move every sweep unless actor_move_every says otherwise.

sparse_position_every

Sweeps between visits of sparse_position_move (default 1: every sweep).

uv_split_move

For directed, symmetric and bipartite fits with latent positions (R > 0, or R_row > 0 and R_col > 0; bipartite fits only with dynamic_uv): draw the split of the scale between the two factors exactly (default TRUE). Multiplying \(U\) by \(c\) and \(V\) by \(1/c\) leaves the product, so the likelihood, unchanged; with the covariance of the rows integrated out the factors have a matrix-t prior, and \(\log c\) is drawn from its density along the orbit by a slice step. The conditional draws of the sweep moved the split by a few percent per sweep against a posterior sd of 0.2 to 0.5 (24 to 54 effective draws of 1,600 in the static directed cells of the acceptance sweep, 4 on a 170-actor ordinal panel); the coordinates of the actors the data say little about, and their products, followed it. For static positions at \(R \ge 2\) the rest of the gauge \(U \to UA\), \(V \to VA^{-T}\) follows under the same prior: one slice step for the scale of each column and one for each shear \(A = I + h e_k e_l'\), which together reach every \(A\) of positive determinant; without them the stretch of \(A\) kept an autocorrelation of 0.9 at lag 20 sweeps and the two-chain check refused a dynamic_rho fit on the split. Static symmetric factors split each column of \(U\) against its eigen-weight. With dynamic_uv = TRUE (directed unipartite fits of every dynamic_uv_kind, and bipartite fits) the same orbit is drawn for the position paths: \(U_t \to cU_t\), \(V_t \to V_t/c\) for all periods together, then for each period alone, each \(\log c\) by a slice step from the AR(1) prior of the paths (with the scale-mixture weights of kind "t" and the resets of kind "snap") and the Jacobian of the map, cut at prior$uv_max_abs. Without it the two-chain check refused fits on the split \(\log(||U_t|| / ||V_t||)\). The paths then draw the rest of their common gauge \(U_t \to U_t A\), \(V_t \to V_t A^{-T}\) for every period together (bipartite paths against \(G \to A^{-1}G\), \(G \to G C^{-T}\)): the scale of each column by a slice step and each shear \(A = I + h e_k e_l'\) as a Gaussian, both from the path prior along the orbit and the Jacobian; symmetric "ar1" and "snap" paths split each column against its weight. The two-chain check monitors the split of symmetric fits too (\(V = UL\), named uv_split as for directed fits). Recorded in fit$uv_split_move (visits, and visits that moved the split). FALSE omits the draw.

uv_rotation_move

For directed unipartite fits with dynamic_uv = TRUE and R >= 2, of every dynamic_uv_kind: draw the orientation of the position paths exactly (default TRUE). \(U_s \to U_s Q\), \(V_s \to V_s Q\) for \(s = t, \dots, N\) with \(Q\) orthogonal (a rotation or a reflection) leaves every \(U_s V_s'\), so the likelihood, unchanged, and changes the AR(1) prior of the paths only through the transition into \(t\); \(Q\) then has a matrix Fisher density (with the scale-mixture weights of kind "t" and the resets of kind "snap"), drawn for each \(t = 2, \dots, N\) one coordinate plane at a time from its two von Mises components, cut at prior$uv_max_abs. Under kind "snap" each plane also tries its mirror image with the resets of that transition summed out, by a Metropolis step, and those resets are then drawn again. The conditional draws cannot reach a reflection, and without the move a kind "snap" chain whose later periods came out reflected against an earlier one explained it by resetting most actors there, so the two-chain check refused rank-2 fits on AR(1) data. Recorded in fit$uv_rotation_move (visits, and visits that moved an orientation). Bipartite fits carry \(U_t G V_t'\) with \(G\) common to the periods and have no such freedom beyond the signs along \(G\). Symmetric "snap" fits at R >= 2 draw the same freedom of \(U_t L U_t'\): for each pair of coordinates, the rotation (weights of one sign) or boost (weights of opposite signs) of the pair in the coordinates scaled by \(|L|^{1/2}\), applied from each period on, by a slice step along its group from the path prior given the resets (the conditional draws turn a period only one actor at a time). FALSE omits the draw.

uv_rho_flip_move

For fits with dynamic_uv = TRUE (unipartite and bipartite, directed and symmetric, every rank and every dynamic_uv_kind): a Metropolis move between \(\rho_{uv}\) and its mirror image, once per sweep (default TRUE). Changing the sign of \(\rho_{uv}\) together with the sign of every position in every second period, \(x_t \to (-1)^{t-1} x_t\) on both sides, leaves each product \(U_t V_t'\) (\(U_t G V_t'\), \(U_t L U_t'\)), so the likelihood, and each transition \(x_t - \rho_{uv} x_{t-1}\) up to its sign, so the AR(1) prior of the paths with its resets and weights; only the prior of \(\rho_{uv}\) tells the two states apart, and the move is accepted with probability \(\min\{1, \pi(-\rho_{uv}) / \pi(\rho_{uv})\}\). Its uniform is the one the draw of \(\rho_{uv}\) in the same sweep used, rescaled, so the move draws no random numbers. The conditional draws of the paths and of \(\rho_{uv}\) cannot cross between the two states: a chain whose \(\rho_{uv}\) passed zero early in the burn-in took alternating period signs and stayed at the negative mirror of the persistence, and the two-chain check refused it on \(\rho_{uv}\). Recorded in fit$uv_rho_flip_move (visits, and visits that moved to the mirror). FALSE omits the move. Since the data see \(|\rho_{uv}|\) only, every stored draw is kept in the gauge \(\rho_{uv} \ge 0\): a draw taken at negative \(\rho_{uv}\) is stored as its mirror (the same likelihood and path prior), so fit$rho_uv, fit$U_draws and fit$V_draws, the forecast states, the two-chain check and trace_plot() all see one gauge; the sampler itself goes on from its state, and fit$start_vals holds that state.

uv_sym_sign_move

For symmetric fits with dynamic_uv = TRUE: an exact draw, every sweep, of the sign of each coordinate path in each period (default TRUE). Changing the sign of coordinate \(r\) of every actor in period \(t\) leaves \(U_t L U_t'\), so the likelihood; the AR(1) prior of the unit-variance paths sees the signs through the products of adjacent periods only (of the drifting transitions under kind "snap", a reset position being symmetric about zero), and the relative signs are drawn from their exact conditional. The conditional draws of the paths cannot change a sign, so without the move two chains could keep different signs in some periods and report different persistences (the two-chain check refused 6 of 24 weakly informed symmetric panels under the default prior, 1 with the move). Recorded in fit$uv_sym_sign_move (visits, and visits that changed a sign). FALSE omits the move.

uv_sym_pair_move

For symmetric fits with dynamic_uv = TRUE of the "ar1" kind and R >= 2 ("snap" fits draw the same group given their resets, see uv_rotation_move): an exact draw, every sweep, of the rest of the gauge of the paths against their weights (default TRUE). \(U_t L U_t'\) is unchanged by \(U_t \to U_t A\) whenever \(A L A' = L\): for two coordinates whose weights have opposite signs \(A\) is a hyperbolic rotation of the coordinates scaled by \(|L_r|^{1/2}\), for two of the same sign a circular one. The angle of each pair is drawn by a slice step from its exact density under the AR(1) prior of the paths, for every period together and from each period on, cut at prior$uv_max_abs. The conditional draws of the paths cannot move along these directions, and without the move a chain at a persistence near 0.9 could sit at a different gauge from the other chain and report a different rho_uv. Recorded in fit$uv_sym_pair_move (visits, and visits that moved a pair). FALSE omits the move.

uv_size_move

For directed and bipartite binary and Poisson fits with dynamic_uv = TRUE: exact draws, every sweep, of the size of the product of the positions in every period together (through \(G\) in bipartite fits, through the paths and sigma_uv in directed ones) and in each period alone (default TRUE). The latent array is integrated out of the binary draws (the dyadic correlation kept through a shared factor) and redrawn after them, and carried with the predictor by the Poisson draws; under kind "t" the weights of the transitions into and out of the period are integrated out and drawn again. The conditional draws move the size of a period's product only as far as the latent array lets them. Recorded in fit$uv_size_move (visits, and visits that moved a size). FALSE omits the draws.

uv_rho_nc_move

For directed and bipartite normal, binary and Poisson fits with dynamic_uv = TRUE, of every dynamic_uv_kind: an exact draw, every sweep, of rho_uv with the stationary variance of the paths and their standardised innovations held, so the paths follow rho_uv and sigma_uv follows the stationary variance (default TRUE). The likelihood of the product enters as for uv_size_move; the unobserved cells of a normal fit are carried. Given the paths rho_uv is pinned far more tightly than its posterior, so its draw alone mixes slowly. Recorded in fit$uv_rho_nc_move (visits, and visits that moved rho_uv). Under "snap", in bipartite fits too, the positions at the resets are held. Symmetric fits draw rho_uv the same way through uv_nc_move. FALSE omits the draw.

ab_shift_move

For directed and bipartite fits without an intercept (intercept = FALSE, the default of "ordinal") with sender and receiver effects (rvar and cvar): draw the shift of the sender effects against the receiver effects exactly (default TRUE). Adding \(c\) to every \(a_i\) and subtracting it from every \(b_j\) leaves every \(a_i + b_j\), so the likelihood, unchanged; only the prior of the effects pins \(c\), and \(c\) is drawn from that normal conditional once per sweep. With dynamic_ab = TRUE the per-actor levels move and the deviations are kept. With an intercept the effects are centred and the draw is not needed. Recorded in fit$ab_shift_move (visits, and visits that moved the effects). FALSE omits the draw.

symmetric_node_tie

For symmetric binary and ordinal fits with a nodal covariate: draw the row and the column coefficient of the covariate as one (default TRUE). The design carries a nodal covariate twice, and the coefficients of its two slices enter the predictor of a symmetric network only through their mean, so the data leave their difference to its prior. The exact symmetric draws of the binary and ordinal families return a difference of the width of that prior, and the draws of the additive effects, of the positions and of the dynamic coefficients that read the predictor carried it as noise: a fit with dynamic_ab and a time-varying nodal covariate let the node coefficient and the effect paths walk off together (the innovation sd of the paths ran to 20 and more against 0.3), and the persistence of dynamic positions was pulled down. Each draw of the coefficients is now followed by replacing the pair by its mean, which keeps the predictor symmetric. Fits without dynamic effects, positions or coefficients, and the normal and Poisson families, are not affected. FALSE restores the earlier draws.

rho_ab_mean

For dynamic_ab=TRUE: Prior mean for additive effects AR(1) parameter (default: 0.8). Controls temporal smoothness of sender/receiver effects.

rho_ab_sd

For dynamic_ab=TRUE: Prior SD for additive effects AR(1) parameter (default: 0.15).

sigma_ab_shape

For dynamic_ab=TRUE: Shape parameter for inverse-gamma prior on additive effects innovation variance (default: 2).

sigma_ab_scale

For dynamic_ab=TRUE: scale parameter of the inverse-gamma prior on the innovation variance of the effect deviations. It is set once before sampling to the prior mean of Sab (that is etaab * Sab0 / (etaab - 3), the mean of the inverse Wishart the covariance is drawn from) times 1 - rho_ab_mean^2, so that a priori the stationary variance of an actor's deviation path matches the variance of the levels and per-period deviations are still pulled toward the actor's level unless the data insist; it is reported as fit$sigma_ab_prior_scale. This is a prior-scale convention. Because it is read off the prior of the additive-effect covariance rather than its current draw, it still follows the scale of the outcome while leaving the sigma_ab and Sab draws as conditionals of one joint density. Set a value to override it.

ab_var_cap

For dynamic_ab=TRUE: optional bound on the stationary variance of an additive-effect path, in the same units as uv_var_cap; the innovation scale is then drawn so that sigma_ab^2 / (1 - rho_ab^2) stays at or below it. Default Inf (no bound). Set it, for example to 4, only when the additive effects themselves are running away; on a near-separable panel a bound here pushes the separation into the interaction matrix instead.

actor_factor_slice

For supported directed binary rank-two AR(1) factor panels with dynamic actor effects and static coefficients, use paired actor/factor elliptical slice updates of the observed likelihood. Default TRUE; FALSE disables this additional transition. Actor centering and factor bounds are preserved.

bipartite_scale_move

For Gaussian, binary, Poisson or ordinal bipartite panels (the last two with actor_move) with moving AR(1) factors and a static interaction matrix: jointly rescale both factor paths, their innovation scale and the interaction matrix (default TRUE). This preserves fitted values and the original posterior target, including all prior bounds. Set FALSE to retain the conditional updates alone.

marginal_move

Run the joint observed-data updates and associated persistence, scale and translation moves for supported binary configurations (default TRUE); see Details.

binary_scale_move

For "binary" fits (every mode, not with dynamic_rho): draw the factor by which the coefficients and the static additive effects are multiplied, exactly and with the latent array integrated out, every binary_scale_every sweeps (default TRUE); FALSE omits it. See Details.

binary_scale_every

For "binary" fits: number of sweeps between draws of that factor (default 5).

level_move_every

For binary unipartite and bipartite fits: number of sweeps between visits of the scale move (default 30).

level_move_tries

For binary unipartite and bipartite fits: proposals per visit of the scale move (default 8). Raising either this or the frequency buys a longer effective sample along the level / spread ridge at a cost per sweep; the visit pays for the factor draw and the latent redraw once, so more proposals per visit are cheaper than more visits.

dev_move

For binary unipartite dynamic_ab fits: walk the second direction of the scale move, the per-period deviations together with sigma_ab (default TRUE). See Details.

dev_move_tries

Proposals per visit along that direction (default 8).

actor_move

For "poisson" and "ordinal" fits (unipartite, directed or symmetric, or bipartite; static or dynamic_ab effects; static coefficients or, for the level translations, dynamic_beta of kind "ar1" or "rw1"): run the translations of the levels with their latent rows and columns, and the further updates listed in Details (default TRUE). For binary fits (unipartite: directed or symmetric, with any additive margin and static coefficients or dynamic_beta of kind "ar1" or "rw1", incomplete panels included; or bipartite with an additive margin or static positions, with static coefficients or dynamic_beta of kind "ar1" or "rw1"): run the collapsed per-actor update (default TRUE). With dynamic_uv, Poisson and binary fits also redraw the position paths (actor_move_paths). See Details.

chain_extensions

Number of times the chains are continued while the drift check or the between-chain check flags them (a drifting chain, an R-hat above its threshold, or a series with too few effective draws to compare the chains; default 3). Chains that still drift or disagree after the last extension are returned with a warning of class lame_chain_unsettled and fit$auto_extend$settled = FALSE; chains still too short to compare are returned with a warning of class lame_chain_not_compared; 0 decides on the first block. An extension is a block of nscan sweeps, longer when series are short of effective draws (see the convergence policy).

actor_move_every

Number of sweeps between visits of the collapsed per-actor update (default 10), of the translations of the Poisson (default 2) and ordinal (default 10) families. The position paths of a dynamic_uv_kind = "snap" fit are visited every sweep (a binary fit by default; the other families always, Poisson with its translations).

actor_move_rho

For directed fits with dcor = TRUE, also update the dyadic correlation with the latent responses integrated out at each visit of the collapsed per-actor update (default TRUE).

beta_hyper_nc

For dynamic_beta fits: run the interweaving step that moves the hyperparameters of the coefficient paths with the path (default TRUE); FALSE omits it and keeps the draws at every sweep. See the dynamic_beta argument.

poisson_period_move

For "poisson" fits with dynamic_beta: translate every period, and the whole path, of each dynamic coefficient with its latent slice at every sweep (default TRUE); FALSE omits them. See Details.

poisson_static_move

For "poisson" fits with dynamic_beta and static coefficients: translate each static coefficient with the whole latent array every actor_move_every sweeps (default TRUE).

ordinal_scale_move

For "ordinal" fits (unipartite and bipartite, static or dynamic coefficients and effects): draw, at every sweep, the scale of the whole state (the coefficients, the static additive effects and the latent array together, with the free cutpoints of ordinal_cutpoints = "explicit") and, with the default data-induced cutpoints, the shift and the scale of the latent array of each period alone, each exactly along a transformation that keeps every rank (default TRUE); FALSE omits them. See Details.

actor_hyper_nc

For dynamic_beta_per_actor fits: run the interweaving step that moves the innovation variance and the persistence of the actor-specific paths with the paths (default TRUE); FALSE omits it and keeps the draws at every sweep.

actor_move_paths

For Poisson and binary fits with moving positions (dynamic_uv = TRUE), and for every family under kind "snap": redraw the whole position path of each actor at each visit (default TRUE), under kind "snap" with the resets summed out and then drawn again; FALSE omits it and leaves the other updates of actor_move as they are. See Details.

ab_hyper_move

For dynamic_ab fits with an additive margin (every family and mode): draw the level variances (their covariance for directed unipartite fits), the innovation scale and the persistence of the additive effects given their totals with the levels integrated out (default TRUE). See Details.

ab_hyper_move_tries

Proposals per sweep of that update (default 8).

ab_period_move

For "poisson" fits with dynamic_ab: move each actor-period effect together with the latent values of its row (column), in pairs when the effects of a period sum to zero, exactly and at every sweep (default TRUE). See Details.

uv_g_scale_move

For bipartite fits with static positions: draw the scale split between the positions and the interaction matrix exactly (default TRUE). See Details.

als_start

For directed unipartite dynamic_uv fits of the "ar1" or "t" kind (normal, Poisson or binary outcome): start the chain from a dynamic AR(1) ALS fit of the same model (default TRUE; see Details). FALSE keeps the cold start.

snap_kappa

For dynamic_uv_kind = "snap": the sd of the position a reset lands on. Unset (the default), a reset is a fresh draw from the stationary distribution of the position paths, \(\kappa^2 = \sigma_{uv}^2 / (1 - \rho_{uv}^2)\), recomputed every sweep, and the reset positions enter the rho_uv and sigma_uv draws as stationary draws. A positive number fixes the scale. A fixed scale well above the positions' spread makes a reset implausible for any ordinary jump; choose this scale in the units of the latent coordinates (the unit-variance paths of a symmetric fit, whose linked scale is 1).

rho_beta_mean

For dynamic_beta: Prior mean for the per-block AR(1) parameter on time-varying regression coefficients (default: 0.8). Closer to 1 = smoother evolution.

rho_beta_sd

For dynamic_beta: Prior SD for the per-block AR(1) parameter (default: 0.15).

rho_beta_lower

For dynamic_beta: Lower truncation bound on the AR(1) parameter (default: 0). Pass a negative value to allow negative autoregression.

rho_beta_upper

For dynamic_beta: Upper truncation bound (default: 0.999). Closer to 1 admits near-unit-root behaviour.

sigma_beta_shape

For dynamic_beta: shape parameter of the inverse-Gamma prior on the per-block innovation variance (default: 2). The conditional combines this proper prior with the coefficient path's quadratic form and effective dimension under its selected temporal law. With few transitions informing a coefficient block the posterior of the innovation variance stays near this prior.

sigma_beta_scale

For dynamic_beta: scale parameter of the inverse-Gamma prior on the per-block innovation variance. It is set once before sampling from the response scale: the innovation covariance of the coefficient path is sigma_beta^2 Lambda with Lambda the g-prior scale matrix, so sigma_beta is the per-period innovation sd of a covariate's contribution to the linear predictor in the units of the response. The default prior mean innovation variance is 0.04 times the residual variance (the variance of the two-way centred outcome for the normal and poisson families, 1 for the probit and rank families, whose latent scale is fixed). It is reported as fit$sigma_beta_prior_scale. Set a value to override it.

sigma_beta_init

For dynamic_beta: Initial value of the per-block innovation standard deviation (default: 0.25; 0.25 * sd(Y) for the normal family). Affects mixing, not the stationary distribution.

beta0_mean

For dynamic_beta: Mean of the Gaussian prior on the first observed coefficient state under RW1 (default: 0). An AR(1) path starts from its stationary law around its long-run mean, whose prior is that of a static coefficient (see dynamic_beta).

beta0_var

For dynamic_beta: Variance of the Gaussian prior on the first observed coefficient state under RW1 (default: 10; 10 * var(Y) for the normal family, in the unit of the response). This prior is independent of the sampled evolution parameters. RW2 uses its proper difference-precision prior and Matern 3/2 its covariance kernel over all observed periods instead.

Common usage: prior = list(Sab0 = diag(c(1, 1)), eta0 = 10) for stronger shrinkage, or prior = list(rho_uv_mean = 0.95) for higher temporal persistence, or prior = list(rho_beta_mean = 0.95, sigma_beta_scale = 0.01) for very smooth time-varying coefficients with tight innovations.

g

optional scalar or vector for g-prior on regression coefficients. Default is n^2, where n is the number of actors (nA for a bipartite fit). The prior of the normal family scales with the response, for every unit of Y. The static coefficients of a unipartite fit have the panel prior with precision sum_t(crossprod(X_t)) / (T g), whatever the residual variance, and take g = n^2 * var(Y) (n^2 where the link fixes the scale); when other coefficients have paths (dynamic_beta, or the intercept path that dynamic_ab adds), the static ones keep the marginal of that same prior, so the prior of a static slope does not depend on whether another coefficient moves. The coefficients of a bipartite fit have the prior N(0, g s2), whose s2 already carries the unit, and take n^2 divided, for a slope, by the mean square of its covariate, with or without paths. In both modes the unit of a covariate only rescales its coefficient. The g-prior controls the variance of regression coefficients: larger values allow for larger coefficient values. Can be a vector of length p for parameter-specific control. The default is a unit-information prior on the scale of a unit-variance Gaussian response. In a binary model a cell carries about a tenth of that information, so the default acts like about ten cells. On sparse or weak data it stabilises the coefficients and holds separated ones finite; when the signal is very strong it pulls slopes toward zero by about ten cells over the number of observed cells, 1 to 2 percent on networks of 500 to 1,000 cells. A larger g weakens the prior. In a unipartite fit lame() gives the intercept the same unit information, while ame() leaves it nearly flat, so the two can differ on a covariate collinear with the intercept.

seed

random seed for the MCMC sampler (default 6886). The sampler is seeded internally with this value, so results are reproducible by default and an external set.seed() call has no effect on the chain – pass a different seed here to vary the draws (e.g. when running multiple chains). The caller's .Random.seed is restored on exit, so fitting never perturbs your RNG stream. Changing nscan or burn changes the whole chain, not only its length, because the sweep permutations are drawn up front; to lengthen a finished chain use lame_resume.

nscan

number of iterations of the Markov chain (beyond burn-in)

burn

burn in for the Markov chain

odens

output density for the Markov chain

plot

logical: plot results while running?

verbose

logical: print progress while running? Default FALSE. A dynamic fit with method = "als" names each stage as it starts (the start fit, the position-scale search and its polish), prints a line every 25 passes (the pass count and budget, the stage, the inner fit, the largest scaled residual, the objective and the elapsed time), and closes with the passes and inner fits of the whole fit.

gof

logical: calculate goodness of fit statistics?

start_vals

list of parameter starting values for the MCMC chain. Tempered fits accept their own fit$start_vals replica matrix as a warm start; use lame_resume for exact continuation. dynamic_uv fits of the "ar1" kind start from a dynamic ALS fit by default when this is NULL (see Details). Use als_start_vals to start MCMC from an ALS fit, or the start_vals element of a previous fit to continue from its final state. Recognised slots are Z, beta, a, b, U, V, rho, s2, Sab and, for dynamic fits, the scalars rho_uv, sigma_uv, rho_ab and sigma_ab; bipartite fits also take G, use a slot only when its shape matches the panel and warn about the ones they skip. The rho_uv, sigma_uv, rho_ab and sigma_ab values that als_start_vals emits only seed the chain: for the empirical-Bayes fit of normal, binary and Poisson panels they are the values of its search under the lame() hyperprior (fit$eb$uv_dynamics, fit$eb$ab_dynamics), estimates where their estimated flag is TRUE and working values otherwise.

periodic_save

logical: indicating whether to periodically save MCMC results

out_file

character vector indicating name and path in which file should be stored if periodic_save is selected. For example, on an Apple OS out_file="~/Desktop/ameFit.rda".

save_interval

quantile interval indicating when to save during the post-burn-in period.

model.name

optional string for model selection output

save_log_lik

one of FALSE (default), TRUE, or "chunked". When TRUE, stores the per-iteration pointwise log-likelihood matrix on fit$log_lik (an [n_stored, n_obs] double matrix). When "chunked", streams the log-lik values to per-column-chunk binary files under log_lik_path so the in-memory cost during MCMC is just one chunk's width; the chunks are recovered later via read_log_lik(fit). Required for loo::loo(fit) and loo::waic(fit).

posterior_opts

optional list of posterior draw-storage options, either a plain list() or one built with posterior_options (which spells the position option save_UV). Recognised names (unknown names trigger a warning): save_UV, save_UV_draws, save_ab, thin_UV, thin_ab. save_UV = TRUE and save_UV_draws = TRUE are aliases on this path. With dynamic_uv = TRUE they store the per-iteration dynamic latent-position cubes at every stored (odens) iteration on fit$U_draws / fit$V_draws, each an [actor, dim, period, draw] array. On a static fit with a positive multiplicative rank they store the per-iteration latent-position matrices on fit$U_samples / fit$V_samples ([actor, dim, draw] arrays, as ame does). Bipartite fits with positive latent ranks additionally store the interaction-matrix draws on fit$G_samples ([R_row, R_col, draw]). save_ab = TRUE stores identified additive-effect draws in a_samples / b_samples (actor by draw) for static effects, or a_draws / b_draws (actor by period by draw) for dynamic effects, with actor-level draws in a_level_samples / b_level_samples. thin_ab thins the retained coefficient draws further; ab_draw_index records their matching row indices. Compact joint terminal states are always retained on fit$forecast_state for posterior forecasts, even when full actor and position trajectories are not requested. thin_UV remains accepted for compatibility but is not applied here (odens already thins the stored chain). Requesting latent draw storage with a zero multiplicative rank warns and stores nothing. Default NULL.

log_lik_path

directory to write log-lik chunks to when save_log_lik = "chunked". Default NULL creates a session-scoped subdirectory under tempdir(). With several chains, chain k writes to its own directory, <log_lik_path>_chain<k>, and read_log_lik(fit) returns the chains stacked in the order of the pooled draws. lame_resume() writes the block it adds to <log_lik_path>_resume<k>, so the chunks of the fit it continues stay readable.

log_lik_chunk_size

column-width of each on-disk chunk when save_log_lik = "chunked". Larger chunks mean fewer files (and one readBin per chunk on read) but more memory during MCMC. Default 10000L.

keep_snap_draws

controls storage of post-burn-in MCMC snap-shift indicators when dynamic_uv = TRUE and dynamic_uv_kind = "snap". "none" keeps only the posterior mean snap probabilities. "summary" stores cell-level count, mean, and variance summaries. "draws" stores retained binary indicator arrays as fit$snap_draws and, for directed and bipartite fits (the column actors of a bipartite fit), fit$snap_draws_v, with dimensions draw x actor x time and first period set to NA.

freeze_call

logical: if TRUE, store a snapshot of the evaluated Y, Xdyad, Xrow, Xcol on fit$data_snapshot so that a later update(fit, ...) refits against the same data even if the caller has mutated those objects in their workspace. Memory cost equals the size of the data; default FALSE.

dynamic_beta_pool

one of "none" (default), "rho", "sigma", or "both". When two or more coefficient blocks are dynamic, non-"none" values update shared hyperparameters across blocks for the selected persistence and / or innovation-scale component. Persistence pooling uses a Gaussian hierarchy on the logit of (rho - rho_beta_lower) / (rho_beta_upper - rho_beta_lower), with a normal mean prior and inverse-Gamma variance prior. Its current mean and scale are retained in checkpoint state. With a single dynamic block the value is recorded but there is no other block to pool against. On method = "als" the empirical-Bayes estimator honours it: "sigma" shares the innovation scales across the dynamic blocks, "rho" pools the first-order persistences through the same logit-normal hierarchy as the sampler (a random-walk block has none to pool), "both" does both; the penalised routes name it in the warning about ignored arguments.

dynamic_beta_per_actor

optional, one of NULL (default), "row", or "col". When non-NULL, fits actor-specific time-varying deviations for one dyadic covariate on the selected margin. The default per_actor_identifiability = "center" keeps the population coefficient in coef(fit) and enforces a per-period sum-to-zero constraint on the actor deviations. Their innovation variance defaults to an inverse-Gamma(2, 1) prior (scale var(Y) for the normal family: the unit of the response), configurable through prior$sigma_actor_shape and prior$sigma_actor_scale. The transformed persistence \((1 + \rho)/2\) defaults to a Beta(2, 2) prior, with shapes prior$rho_actor_shape1 and prior$rho_actor_shape2, restricted to \(-0.99 < \rho < 0.99\), with a stationary initial state. Priors act on the centered subspace with one fewer dimension than the actor count. All four hyperparameters must be finite and positive. Choose the innovation scale for the outcome and covariate units. Stored fits record these choices in per_actor_prior. Draws are stored in fit$THETA_ACTOR when retained; summary mode stores fit$theta_actor_mean and fit$theta_actor_sd. The innovation variance and the persistence are drawn from their exact conditionals at every sweep from the first one, and an interweaving step moves them together with the paths (prior$actor_hyper_nc). Where each actor's data say little about its path, which is the usual case, the draws at every sweep leave them with 220 to 900 effective draws in 2,000, and the step multiplies that by 1.1 to 2.4.

per_actor_covariate_idx

positive integer; index into the dyadic covariate cube to slope on for the per-actor extension. Default 1L.

per_actor_identifiability

one of "center" (default) or "exact_center". "center" preserves the population coefficient and constrains the per-actor deviations to sum to zero per period via pairwise contrast FFBS. "exact_center" draws each actor's path from its own conditional AR(1) posterior and conditions on all period-wise sum-to-zero constraints using the complete temporal covariance. Dyadic reciprocity couples actors; that case uses a joint Gaussian draw on the constrained subspace, at a higher cost per sweep. Actor-specific slopes require directed or bipartite data and unit-spaced periods.

keep_per_actor

one of "auto" (default; full draws when memory cost < 250 MB else streaming summary), "draws" (full [n_iter, n_actors, T] cube), "summary" (streaming posterior mean + sd only), or "none" (only hyperparameter chains).

time_index

optional numeric vector of length \(T\) giving observation times. Default NULL treats periods as equally spaced. Strictly-increasing values are required when supplied. Unequal gaps scale the AR(1) / RW1 transition variance and are also used by the RW2 and Matern 3/2 dynamic-beta precision builders.

period_exposure

optional non-negative numeric vector of length \(T\) giving period-level exposure offsets. Wired for Poisson: when supplied with any value != 1, the Poisson observation likelihood becomes \(Y_{ij,t} \sim \text{Poisson}(e_t \cdot \exp(Z_{ij,t}))\), while the latent \(Z\) retains its existing semantic of "unexposed log-rate". For other families, non-trivial period_exposure is an error (rescale Y or use a covariate offset). NULL (default) or all-ones uses the unscaled likelihood path. Zero exposure is supported when all observed counts in that period are zero; its observed log-likelihood is zero.

max_seconds

optional positive scalar; if the MCMC wall-clock time exceeds this many seconds, the chain terminates cleanly and fit$terminated_early is set to TRUE. The draw arrays hold the draws stored until then. When the time runs out before the first stored draw, fit$no_draws_stored is TRUE, every draw array (BETA, VC and the others) has no draws along its draw dimension, the posterior means are NA, print() says so, and coef(), summary() and the other methods that summarise draws stop with an error of class lame_no_draws; lame_resume(fit, nscan_more = N, max_seconds = Inf) continues the chains.

checkpoint_path

optional file path. When set, the chain periodically writes BETA, VC, the full sampler state, seed, completed iteration count, remaining burn-in and original call to this file. Use lame_resume or pass the same path back as resume_from = path to continue.

checkpoint_every

positive integer; iterations between checkpoint writes. Default 100L.

log_lik_method

one of "observed_exact" (default), "observed_approx", or "augmented". Observed marginal scores are supported for normal, binary, Poisson-lognormal and explicit-cutpoint ordinal fits. Poisson integration uses an adaptive log-integral with concavity bounds on omitted tails. Data-induced ordinal models do not have the cellwise observed likelihood claimed by "observed_exact"; such requests fail explicitly. "observed_approx" stores the scores of "observed_exact" for those fits and, for a data-induced ordinal fit, the closed-form cumulative-probit score at cutpoints set from the observed category shares, an approximate diagnostic. "augmented" stores Gaussian-on-Z latent diagnostics. loo() and waic() refuse the approximate ordinal and the augmented scores with an error of class "lame_loo_factorization_unsupported", and read_log_lik() returns the scores. Even correct cell marginal scores require independent residual cells, or unique unordered dyads in symmetric fits, before LOO or WAIC can use them. Directed correlated cell marginals require joint dyad factors, which are not supplied by this interface. Inspect fit$log_lik_contract. "augmented" uses the augmented-data Gaussian-on-\(Z\) contribution.

ordinal_cutpoints

character: cutpoint convention for family = "ordinal". "data_induced" (default) uses the data-induced cutpoints; "explicit" samples ordered cutpoints with the first fixed at zero and unit latent residual variance. Independent directed and symmetric models use the Cowles (1996) marginal Metropolis-Hastings update. Directed models with dcor = TRUE use cutpoint Gibbs updates conditional on the correlated latent observations. Explicit cutpoints are supported for unipartite models; predictions retain the original numeric category labels and use each saved cutpoint draw. Ignored for other families.

method

character: "mcmc" (default, the Bayesian MCMC fit) or "als" (the fast, MCMC-free empirical-Bayes fit, which reports a standard error for every estimate). With no dynamic arguments, method = "als" uses the pooled-static lame_als estimator; when that fit keeps fewer multiplicative dimensions than R it says so with a warning of class "lame_als_retirement" (for a binary panel, that a weaker product may remain, which method = "mcmc" resolves). Both methods return named actors sorted by name. For normal, binary, and Poisson panels, method = "als" also supports a dynamic empirical-Bayes estimator (see the section Dynamic fast fits) for dynamic_ab, selected dynamic_beta, smooth AR(1) dynamic_uv in directed, symmetric, and bipartite panels, and Student-t dynamic_uv in directed and symmetric panels (bipartite t requests are refused). dynamic_uv_kind = "snap" is refused on this route (use method = "mcmc"). On the dynamic route rho_ab, sigma_ab, rho_uv, sigma_uv, rho_beta and sigma_beta are set under the hyperpriors of lame() (the variance components and persistences by EM, the stationary variance of moving positions by a profile of the marginal objective). The fit can seed a warm-started MCMC run via als_start_vals. Under dynamic_ab the reported VC entries va and vb are the variances of the actor levels, as in an MCMC fit, estimated by EM (fit$eb$sab). Node-covariate coefficients use the same orthogonal additive-effect decomposition as lame_als; dynamic node coefficients use period-specific node values when selected by dynamic_beta, while static node coefficients use per-actor means. Named changing-composition panels are aligned to the union actor set; the fit treats an absent actor-period as a free AR state. Posterior draws and the ordinal family are not handled by the ALS routes. Dynamic ALS prediction evaluates the fitted periods, optionally with replacement dyadic covariates; predict(fit, h = ...) forecasting is not implemented and a positive horizon is refused. With method = "als", a binary network whose observed density \(d\) has \(\min(d, 1 - d) < 0.20\) (ties among the observed cells, the diagonal of a one-mode network left out, pooled over periods) is fitted with a warning: there the sampler is the better choice.

als_stability

character (only used when method = "als" and a dynamic ALS path is selected): "none" (default), "quick", or "validation". The non-"none" presets rerun the dynamic ALS fit from jittered starts and attach fit$stability, which reports fitted-surface and coefficient-path differences across starts.

als_max_iter

positive integer (only used when method = "als"): maximum iterations for the selected ALS solver. Default 1000. A dynamic fit runs several reweighting loops (a start fit, the inner fits of a position-scale search and a polish); each takes at most als_max_iter passes, and the whole fit at most 20 * als_max_iter. A binary fit with R = 0 of a 117-actor, 27-period panel takes about 100 passes and one with moving rank-2 positions about 2,000, so the budget bounds the worst case only. On both routes a fit that has not met its convergence criterion is returned at its last iterate with a warning of class "lame_als_unsettled": a dynamic fit when a loop or the budget runs out, with the stage, the passes used and the remedy (the record is fit$eb$unsettled; fit$eb$passes holds the passes and inner fits of every dynamic fit), and a static fit when its iteration limit runs out; a static fit is refused (class "lame_als_convergence") only when its estimates and standard errors cannot be formed at its last iterate (see max_iter in ame_als).

als_tol

optional positive scalar (only used when method = "als"): convergence tolerance for the ALS objective and fitted values. NULL keeps each ALS estimator's built-in default. The dynamic empirical-Bayes estimator stops when every block's scaled score is below sqrt(als_tol) and, for moving positions, the objective has settled to within als_tol deviance units of the fixed point; for a Poisson fit the estimated distance of the noise variance ve to the limit of its iteration must be below the threshold as well.

als_lowrank_method

optional character: inner solver for the low-rank factor block of the dynamic fast fit that seeds the warm start of a dynamic_uv chain (see Details), "mm", "als", or "hybrid". NULL (default) keeps "hybrid". With method = "als" the dynamic empirical-Bayes estimator solves the factors jointly with the other effects by Gauss-Newton and warns that the argument does not apply; the static fast route (no dynamic arguments) does not use it.

als_linear_solver

optional character (only used when method = "als" with no dynamic arguments): linear solver for the static block updates, "eigen", "qr", or "auto". NULL (default) keeps lame_als's default ("eigen"). The dynamic ALS route uses its own path solvers and aborts if a value is given.

als_multistart

optional character (only used when method = "als" with no dynamic arguments, and R > 0): "none", "cheap", or "full", forwarded to lame_als. NULL (default) defers to multistart. Supplying both uses als_multistart.

multistart

character (only used when method = "als" with no dynamic arguments, and R > 0): "none" (default), "cheap" (4 starts), or "full" (8 starts). Forwarded to lame_als, which reruns the block-coordinate fit from several starts and keeps the one with the lowest objective. The dynamic ALS route has no multi-start and ignores this argument with a warning; use als_stability there instead.

bootstrap

integer (only used when method = "als"): number of bootstrap replicates. 0 (default) skips the bootstrap: every fit already carries analytic standard errors. N >= 30 runs N replicates of a static fit and attaches the result, so that vcov(), confint and summary() report the bootstrap errors of the coefficients, with the analytic error kept for any quantity the bootstrap gives none (a smaller positive N is an error, raised before anything is fitted). Each replicate is drawn as ame_als_bootstrap draws it and refit from the fitted state; a replicate that has not converged within als_max_iter iterations is retried at four times that budget and otherwise dropped, never kept. A bootstrap that cannot run on the fitted model (more than 5 percent of the replicates dropped, for example), and any bootstrap of a dynamic fit, whose empirical-Bayes standard errors are its own, leaves the fit with its analytic standard errors and a message of class "lame_als_bootstrap_not_run".

bootstrap_type

character (only used when method = "als"): "parametric" (default) or "block". The block scheme needs at least ten resampling blocks (ceiling(T / bootstrap_block_length)); on a shorter panel it runs the parametric scheme instead, with a message. The block scheme gives no replicate standard error for the parameters that resampling time slices cannot vary (see ame_als_bootstrap); they keep their analytic errors.

bootstrap_block_length

integer: block length for the block bootstrap.

bootstrap_seed

optional integer seed for the bootstrap.

chains

integer: the number of independently seeded chains (default 2, or getOption("lame.chains")). Chain \(k\) runs with seed seed + 1000 * (k - 1). With chains > 1 the chains are checked, compared and pooled (see the convergence policy); chains = 1 runs one chain and the drift check only. ALS fits run one chain.

cores

integer or NULL: workers for the chains. The chains run forked on Unix, at most one worker per chain; NULL uses getOption("lame.cores") if set and otherwise all cores but one. Windows runs the chains one after the other.

resume_from

optional path to a checkpoint file produced by a previous lame(..., checkpoint_path = path) call. When non-NULL, lame() short-circuits all other input parsing and delegates to lame_resume with the user-supplied overrides forwarded. Pass nscan = K to request K additional post-burn sweeps on the continuation. Supply checkpoint_path and max_seconds again to checkpoint or limit the continuation. Unfinished burn-in is completed before any new posterior draws are stored. Default NULL.

sampler

MCMC transition method. Default "gibbs" retains the established sampler. "tempered" uses exact observed-probit replica exchange for symmetric binary networks with positive static rank, a random-walk intercept and optional symmetric dyadic covariates, and shared dynamic additive effects on a common actor grid. Its default burn-in is 15,000 sweeps and default post-burn length is 200,000 sweeps. See Details for its explicit latent-coordinate prior and supported options.

Value

auto_extend

the record of the convergence policy: max_extensions, extensions (made), discarded_sweeps, triggers (a list with the flagged quantities of each extension), settled (FALSE when the chain was still moving after the last extension) and the thresholds used.

BETA

posterior samples of regression coefficients. A 2-dimensional matrix [n_stored, p] when all coefficients are static. When dynamic_beta flags any coefficient as time-varying, BETA is a 3-dimensional array [n_stored, p, T] whose third dimension is the time period. Static coefficients are still present with their values replicated across the third dimension. coef(fit) collapses this to a [p, T] posterior-mean matrix.

Migration from amen. Under amen::ame() the BETA slot was always 2-D. Scripts that compute apply(fit$BETA, 2, mean) on an amen fit will silently aggregate across periods when run against a lame() fit with dynamic_beta active (the second margin is the coefficient index in both shapes; the new third margin is time). Use length(dim(fit$BETA)) to detect the shape, or call coef(fit) which returns a [p, T] matrix in either case.

VC

posterior samples of the variance parameters. On a unipartite directed binary panel of two periods or more carrying fewer than 1.2 events per actor-period, the draws of va and vb are kept here but summary(), print() and confint() report them as not estimated, with the measured coverage. Under a supplied effects prior the variance draws are reported under it (see prior_supplied)

events_per_actor_period

for the families with an event rate (binary, poisson) on a panel of at least two periods, the mean over periods of the events per row actor; the rate the reporting methods read

events_per_actor

on the same panels, the events per row actor over the whole panel (every period's events over the actors present in any period), quoted with the rate

prior_supplied

TRUE when prior carried Sab0, eta0 or etaab: where the data alone leave the effect variances to the prior (the sparse rule) the reporting methods then show them under the supplied prior

APM

posterior mean of additive row effects a

BPM

posterior mean of additive column effects b

APM_sd, BPM_sd

posterior standard deviation of each additive effect (static effects), used by simulate() to draw the effects

U

multiplicative row effects u. For static positions, a matrix (n x R) that factors the posterior mean product at rank R, columns in decreasing order of its singular values. For dynamic_uv = TRUE, a 3D array (n x R x T) whose periods factor the posterior mean product of each period at rank R and are aligned across periods; NA for an actor absent from a period (see latent_positions)

V

multiplicative column effects v (asymmetric case), with the same layout as U

U_sd, V_sd

for static positions with saved latent draws (posterior_options(save_UV = TRUE)), and for dynamic_uv = TRUE with saved latent draws (the default), the posterior standard deviation of each reported coordinate, each draw matched onto the reported positions by a move that leaves its product unchanged, same shape as U and V; latent_positions() reports them as posterior_sd. A method = "als" fit with static factors (dynamic_ab or dynamic_beta without dynamic_uv) reports the Laplace sd of each reported coordinate, with the directions that leave the product unchanged left out (below the signal threshold at least the variational sd of each row, as ame_als()), and an undirected one also L_sd and L_ci, the sd and interval of each eigenvalue

UVPM

on the union of actors; under changing composition the dynamic array has NA rows and columns for actors absent from a period, and a static fit gives one matrix for every pair. posterior mean of UV

ULUPM

posterior mean of ULU (symmetric case)

L

for symmetric fits, the diagonal of the product \(U L U'\): the eigenvalues of ULUPM when the positions are static; when they are dynamic, one diagonal for every period that carries the scale and sign of each direction, so that \(U_t L U_t'\) is the best rank-R part of each period's ULUPM with those signs

EZ

posterior mean of the linear predictor Z, on the link scale for every family (the log rate for Poisson, the probit scale for the binary and ordinal families); YPM is the response-scale counterpart. For mode = "bipartite", EZ is a list of per-period matrices with the row and column actors as dimnames, in the lexicographic sort of the input actor names (so "r10" sorts before "r2" unless you zero-pad).

YPM

Stored response-scale fitted value, one matrix per period: the average over the stored draws of the mean response given each draw, which is the tie probability for binary fits, the linear predictor for normal fits and the expected category value for ordinal fits with explicit cutpoints. For data-induced ordinal fits it is the average of ten outcomes replicated at each stored draw. For Poisson fits it is the mean count \(e_t \exp(\eta + \sigma^2 / 2)\) at the posterior means of the linear predictor and of the residual variance; see the Poisson model details.

coefficient_prior

Recorded specification of the coefficient prior used by the fitting build, as displayed by prior_summary().

static_uv_prior

For static asymmetric unipartite factors, the inverse-Wishart covariance prior's degrees of freedom, scale and dimension, the data scale \(s\) of Suv0 = s I (data_scale) and the multiplier of \(2R + 2\) in the degrees of freedom (df_multiplier; see kappa0 in ame). Older fit objects do not carry this record.

sampler_health

A data frame separating numerical failures from valid prior-bound rejections for each conditional sampler step. The compatibility counts in tryErrorChecks and mh_counters contain both. A numerical failure, in a conditional step or in a joint Hamiltonian, actor-factor slice or bipartite scale move, aborts the fit with an error of class lame_sampler_failure (the counts are in the health field of the condition), so a returned fit has none. A proposal outside the prior's box (prior$uv_max_abs, prior$G_max) is a Metropolis rejection of the model, counted here; summary() states it when it is on one percent or more of the sweeps. Joint Hamiltonian acceptance and rejection records are kept in their corresponding move fields. sampler_health_iterations gives the number of sweeps counted, including burn-in.

exact_fallbacks

Named counts of the times a step kept its state after a numerical failure where keeping it leaves the posterior invariant (a block skipped given quantities it does not move, a proposal rejected, or the same conditional drawn by a second kernel). They do not stop the fit; print() and summary() state them, and a count above a tenth of the sweeps warns with class lame_exact_fallbacks. Empty when there was none.

var_cap_hits

number of sweeps in which a stationary-variance cap (prior$uv_var_cap, prior$ab_var_cap) removed most of a conditional draw

level_move

for binary unipartite and bipartite fits, the attempts, accepts, acceptance rate and final step SD of the level direction of the joint scale move (absent when the move did not run)

actor_move

for Poisson and ordinal fits, the work of the translations: visits, the level translations drawn (level_calls) with the likelihood evaluations of the Poisson ones (level_evals) and the steps that failed to terminate (stuck) or that were left to the sampler because the current state lay outside the interval the translation needs (skipped), the draws of the location of the latent array (location_calls, ordinal), the coefficient translations (coef_calls, coef_evals, coef_stuck; Poisson), the position steps (uv_calls, uv_evals, uv_stuck; Poisson with static positions) and the attempts and accepts of the scale move of the dyadic variance and correlation (scale_attempts, scale_accepts, and rho_attempts, rho_accepts of its correlation-only proposals; Poisson: the carried scale move, with dynamic_rho the one of the translations); for binary fits, the work of the collapsed per-actor update: visits, the slice steps of the level translations (level_calls) and of the static positions (uv_calls), the likelihood evaluations they used (level_evals, uv_evals), the steps that failed to terminate (stuck) and the attempts and accepts of the reciprocity update (rho_attempts, rho_accepts; zero for bipartite fits, which add the slice steps of the deviation paths of actor pairs under dynamic_ab, dev_calls and dev_evals); with moving positions, Poisson and binary fits add the path steps drawn (dpm_calls), the likelihood evaluations they used (dpm_evals) and those that failed to terminate (dpm_stuck), and symmetric fits the proposals and accepts of the scale ridge draw (dpm_scale_attempts, dpm_scale_accepts); absent when the updates did not run

beta_hyper_move

for dynamic_beta fits, the sweeps, proposals and accepts of the interweaving step of the path hyperparameters and its acceptance rate; absent when the step did not run

poisson_period_move

for "poisson" fits, the visits, the translations of the periods (period_calls) and of the whole paths (path_calls) and of the static coefficients (static_calls) drawn, the evaluations their slice steps used, and the proposals and accepts of the carried scale move (scale_attempts, scale_accepts, and for the correlation alone scale_rho_attempts, scale_rho_accepts); absent when the moves did not run

binary_scale_move

for "binary" fits, the draws of the scale of the linear predictor (visits), the evaluations of its density they used (evals) and the draws that moved the state (moved); absent when the draw did not run

ordinal_scale_move

for "ordinal" fits, the sweeps the scale moves visited (visits) and the sweeps at which the scale of the whole state moved (orbit_moved); absent when the moves did not run

pa_hyper_move

for dynamic_beta_per_actor fits, the sweeps, proposals and accepts of the interweaving step of the actor-specific slope hyperparameters and its acceptance rate; absent when the step did not run

uv_nc_move

for dynamic_uv fits of the "ar1" and "snap" kinds, the calls and the draws that changed the value (sym_calls, sym_moved, bip_calls, bip_moved) of the non-centred persistence step (symmetric) and scale step (bipartite); absent when the move did not run

uv_nc_hyper_move

for directed and bipartite dynamic_uv fits of the "ar1" kind under the stationary-variance prior (prior$uv_var_shape), the visits and the accepted proposals of the non-centred update of rho_uv and the stationary variance (four proposals of each per visit, and four more of each with the latent array carried along in binary and Poisson fits); absent when the step did not run

uv_temper_move

for symmetric Poisson dynamic_uv fits, the tempered transitions made, accepted and those that changed the sign of the weight; absent when the move did not run

ab_period_move

for "poisson" fits with dynamic_ab, the sweeps, the pairs (or single effects) moved and the slice evaluations of the translations of the actor-period effects; absent when the move did not run

ab_hyper_move

for dynamic_ab fits, the proposals and accepts of the update of the additive-effect hyperparameters given the totals and the acceptance rate; absent when the update did not run

uv_g_scale_move

for bipartite fits with static positions, the number of sweeps and of rescaled coordinates of the draw along the scale ridge of the positions and the interaction matrix; absent when the update did not run

marginal_move

For supported binary fits, joint-update attempts, accepts, acceptance rate, final step size and numerical rejections.

bipartite_scale_move

For supported Gaussian, binary, Poisson or ordinal bipartite fits, joint scale attempts, accepts, acceptance rate, prior-bound rejections and numerical rejections. The fixed proposal requires no adaptive tuning.

actor_factor_slice

For supported binary fits, completed paired actor/factor rounds, block and likelihood evaluation counts, prior-bound rejections, and separate numerical failures.

dynamic_marginal_move

For supported binary fits with moving factors, Hamiltonian attempts, accepts, acceptance rate, tuned step size, numerical rejections, prior-bound rejections and proposals whose likelihood underflowed to zero density (underflow_rejections).

nc_ar_move

Attempts and accepts for the joint persistence and path-scale updates of the factors and actor effects.

translation_move

Number of visits to the factor/actor translation update, counting each margin separately.

rho_collapsed_move

Attempts, accepts and acceptance rate for dyadic correlation updates with binary latent responses integrated out.

uv_scale_move

Attempts, accepts and acceptance rate for joint latent-factor and innovation-scale updates.

dev_move

the same for the deviation direction, present for binary unipartite dynamic_ab fits

als_start

for dynamic_uv fits, whether the chain started from a dynamic ALS fit (FALSE when start values were supplied, when prior$als_start = FALSE, for the snap kind, symmetric and bipartite fits and the rank families, or when the ALS fit failed or fell outside the range the sampler holds)

sigma_ab_prior_scale

for dynamic_ab fits, the inverse-gamma scale of the deviation innovation variance, fixed before sampling

sigma_beta_prior_scale

for dynamic_beta fits, the inverse-gamma scale of the coefficient innovation variance, fixed before sampling from the response scale

G

for bipartite fits, the interaction matrix of \(U G V'\): the identity when the positions are static (the scale is split evenly between U and V, and \(U G V'\) is the best rank-R part of UVPM); when they are dynamic, a diagonal matrix fixed across periods that carries the scale, so that \(U_t G V_t'\) is the best rank-R part of each period's UVPM

GOF

a named list with one element per goodness-of-fit statistic (sd.rowmean, sd.colmean, dyad.dep, cycle.dep, trans.dep; for mode = "bipartite", sd.rowmean, sd.colmean, four.cycles, with four.cycle.dep replacing the count for Gaussian outcomes). Weighted rectangle dependence is NA when no complete rectangle is observed or the values have zero variance; see gof_stats_bipartite. Each element is a [T, 1 + n_stored] matrix: one row per period, the first column the observed value and the rest the posterior predictive draws. For the data-induced ordinal family the predictive draws are quantile-matched to observed category frequencies and assess dependence conditional on those frequencies. Explicit ordinal fits instead use each draw's sampled cutpoints, allowing checks of category frequencies as well. See gof for post-hoc computation and gof_plot for visualization.

a_level, b_level

for dynamic_ab = TRUE, the posterior means of the per-actor levels behind the effect paths; predict() and simulate() propagate the deviation around them

a_dynamic, b_dynamic

for dynamic_ab = TRUE, the posterior mean effect paths (actors by periods), with a_dynamic_sd / b_dynamic_sd their posterior sds

rho_ab, sigma_ab, rho_uv, sigma_uv

draws of the AR(1) persistence and innovation scale of the dynamic effects and positions, when fitted

start_vals

Final parameter values from MCMC, can be used as the input for a future model run.

model.name

Name of the model (if provided)

Details

This command provides posterior inference for parameters in AME models of longitudinal relational data, assuming one of six possible data types/models. The model supports both unipartite networks (square adjacency matrices) and bipartite networks (rectangular adjacency matrices with distinct row and column node sets) across multiple time points.

Tempered symmetric binary sampling:

Set sampler = "tempered" for a common actor grid with family = "binary", symmetric = TRUE, dynamic_ab = TRUE, positive static rank, an intercept and optional symmetric dyadic covariates. At least four actors and two equally spaced periods are required. The observed likelihood contains each unordered dyad once: $$P(Y_{ijt}=1)=\Phi(x_{ijt}^{T}\beta+\mu_t+a_{it}+a_{jt}+u_i^T\Lambda u_j).$$ As on the other routes the intercept moves under dynamic_ab, with the kind dynamic_beta_kind gives it ("rw1" when that is "ar1"). The intercept of period \(t\) is the intercept coefficient plus \(\mu_t\), with \(\mu_1=0\); for "rw1" \(\mu_t-\mu_{t-1}\sim N(0,\sigma_\beta^2\lambda_0)\); for "rw2" the second differences have that distribution and the first increment does too; for "matern32" \(\mu_t\) is the change since the first period of a Matern 3/2 process with variance \(\sigma_\beta^2\lambda_0\) and length scale prior$matern32_length_scale (default \(\max(2, T/4)\) periods). \(\sigma_\beta^2\) is inverse-gamma with shape prior$sigma_beta_shape and scale prior$sigma_beta_scale and \(\lambda_0\) is the innovation scale of the intercept; BETA holds the intercept per period. Shared actor effects comprise a zero-sum level and a zero-sum stationary Gaussian AR(1) deviation. Their level variance has an inverse-gamma prior with shape etaab/2 and scale etaab * Sab0[1,1]/2; the innovation variance has shape sigma_ab_shape and scale sigma_ab_scale. Persistence has its specified normal prior truncated to \((-0.99,0.99)\). Coefficients retain the panel-design Gaussian prior.

prior$uv_prior = "hierarchical" retains the static symmetric factor prior: signed weights are independent standard normals, and each raw coordinate column has variance \(v_k\sim IG(1,0.5)\). This is the default for the tempered sampler. The explicitly selected alternative prior$uv_prior = "unit" fixes every coordinate variance at one; it changes the model's prior, not just its sampling algorithm. Raw factors are centered for reporting, with compensating actor-level and intercept shifts that preserve every joint predictor.

The sampler uses bounded Langevin proposals with their complete forward and reverse Gaussian densities, a fixed ladder of 21 likelihood powers, replica exchanges, prior refreshes at power zero, and signed-weight reflections. After each Langevin step every replica redraws its scale parameters given the centred effects (an interweaving step, Yu and Meng 2011): the level variance from its inverse-gamma conditional given the levels, \((\rho_{ab}, \sigma_{ab})\) jointly given the deviation paths (a slice update of the persistence with the innovation variance integrated out, then the innovation variance), and \(\sigma_\beta\) given the intercept path; the latent effects and every linear predictor are unchanged by this step. It then updates the intercept of each period on its own, by a random-walk Metropolis step that leaves the other periods' intercepts in place. Under the non-centred coordinates of the Langevin step alone these scales and the first-period intercept move as a slow random walk. The replica at power one, whose states are stored, makes four such transitions per sweep and every other replica one. Step sizes adapt only during burn-in. fit$tempering records transition counts, step sizes and replica sign traces, one record per chain in a fit of several chains.

The tempered sampler runs under the same chain policy as the default sampler (see Chains and convergence policy below): two independently seeded chains by default, the drift check and the between-chain R-hat gate on the same monitored set, extensions of every chain and the same chain fields. A chain is extended, and lame_resume continues a fit, from its complete replica state (every replica, the step sizes and both random-number streams), so an extended chain is exactly the chain an uninterrupted run would have produced.

This route accepts only its documented factor and additive prior settings; Sab0 must be a positive multiple of the two by two identity and ab_var_cap must be infinite. Nodal covariates, changing actor sets, time-varying coefficients/factors, exposure, and chunked likelihood output are not supported. save_log_lik = TRUE stores one column per observed unordered dyad-period, also the unit counted by nobs(). Posterior storage uses the same posterior_opts interface, and compact joint terminal states are always retained for forecasts. LFO training windows need at least two periods. Tempered checkpoints restore every replica, the frozen model/prior and both random-number streams; only sampling length, output and time-limit settings can change on continuation. Built-in RNGs with serializable state are supported; Box-Muller and user-supplied RNGs are refused with an error.

Dynamic Effects Implementation:

The dynamic_uv and dynamic_ab parameters enable time-varying latent representations through autoregressive processes. These extensions are particularly useful for understanding how network structure evolves over time.

Dynamic Multiplicative Effects (dynamic_uv=TRUE):

The latent factors U and V evolve according to the transition selected by dynamic_uv_kind. The default "ar1" model uses Gaussian AR(1) drift: $$U_{i,k,t} = \rho_{uv} U_{i,k,t-1} + \epsilon_{i,k,t}$$ where \(\epsilon_{i,k,t} \sim N(0, \sigma_{uv}^2)\), i indexes actors, k indexes latent dimensions, and t indexes time. The parameter \(\rho_{uv}\) controls temporal persistence (values near 1 indicate slow evolution). This captures time-varying homophily, latent community structure, and transitivity dynamics. The "snap" transition uses a mixture of AR(1) drift and discontinuous reset transitions, while "t" uses heavy-tailed Student-t innovations represented by local transition scales: given its scale \(\lambda_{i,t} \sim \mathrm{Gamma}(\nu/2, \nu/2)\) (\(\nu\) = prior$t_nu), the innovation of actor i at period t is \(N(0, \sigma_{uv}^2 / \lambda_{i,t})\). In the MCMC sampler the first period is Student-t with the same \(\nu\) and the stationary scale \(\sigma_{uv} / \sqrt{1 - \rho_{uv}^2}\), drawn as \(N(0, \sigma_{uv}^2 / ((1 - \rho_{uv}^2) \lambda_{i,1}))\) with its own scale \(\lambda_{i,1}\), so that it has the tail of the transitions; the ALS estimator keeps a Gaussian first period. On the MCMC path, snap transitions are supported for directed, bipartite and symmetric models and t transitions for directed unipartite models, at any rank. With method = "als", Student-t dynamic UV is supported for directed and symmetric normal, binary, and Poisson panels, including named panels where actors enter or exit; the snap kind has no ALS route.

Key references:

  • Sewell & Chen (2015): Introduced dynamic latent space models with actor-specific evolution rates

  • Durante & Dunson (2014): Nonparametric Bayesian approach allowing flexible evolution of network structure

  • Hoff (2011): Hierarchical multilinear models providing theoretical foundation for temporal dependencies

Dynamic Additive Effects (dynamic_ab=TRUE): Each sender (a) and receiver (b) effect is a per-actor level plus a zero-mean AR(1) deviation: $$a_{i,t} = \mu^a_i + d_{i,t}, \quad d_{i,t} = \rho_{ab} d_{i,t-1} + \epsilon_{i,t}$$ $$b_{j,t} = \mu^b_j + e_{j,t}, \quad e_{j,t} = \rho_{ab} e_{j,t-1} + \eta_{j,t}$$ where \(\epsilon_{i,t}, \eta_{j,t} \sim N(0, \sigma_{ab}^2)\). The variance of the levels across actors is the reported va / vb; \(\rho_{ab}\) and \(\sigma_{ab}\) describe the deviations. This models time-varying individual activity levels (outdegree) and popularity (indegree).

Identified reporting: Stored static factor draws are centered only when both resolved actor margins are enabled. The removed row, column and grand-mean components of \(U G V'\) are transferred to the actor effects and intercept; for a symmetric shared actor without an intercept, the grand constant is divided equally between its two contributions. Otherwise, the saved draws retain their sampled coordinates because disabled effects cannot absorb the offsets. The reported map preserves the linear predictor and leaves the sampler state unchanged. Dynamic-coordinate reporting follows the supported fitted route; inspect fitted products and predictions when comparing latent geometries.

Dynamic additive effects are useful when sender activity and receiver popularity change over time rather than staying fixed across the whole panel. A dynamic_ab fit returns the posterior-mean paths on fit$a_dynamic / fit$b_dynamic (actor x period) and their per-period posterior standard deviations on fit$a_dynamic_sd / fit$b_dynamic_sd; ab_plot(fit, plot_type = "ribbon") uses the latter to draw a credible band around each actor's path.

Prior Specification for Dynamic Parameters:

  • \(\rho_{uv}, \rho_{ab} \sim TruncNormal(mean, sd, -0.99, 0.99)\): Ensures stationarity of AR(1) process

  • \(\sigma_{uv}^2 / (1 - \rho_{uv}^2) \sim InverseGamma(shape, scale)\) independently of \(\rho_{uv}\): the stationary variance of a coordinate path (prior$uv_var_shape, prior$uv_var_scale)

  • \(\sigma_{ab}^2 \sim InverseGamma(shape, scale)\): Controls innovation variance

  • Default priors (\(\rho_{uv}\) mean=0.7, sd=0.3; \(\rho_{ab}\) mean=0.8) favor persistent evolution

  • Adjust rho_*_mean closer to 1 for slower evolution, closer to 0 for more rapid changes

Computational Considerations:

  • Dynamic effects add path updates; runtime depends on actor count, rank and number of periods

  • Memory usage scales as O(nRT) for dynamic_uv, O(n*T) for dynamic_ab

  • C++ implementation is substantially faster than a pure R loop

  • Convergence diagnostics: Monitor rho and sigma parameters carefully

  • Effective sample sizes typically lower due to temporal correlation

  • A chain that is still moving when the run ends is continued, and returned with a warning and fit$auto_extend$settled = FALSE if it keeps moving (see the convergence policy below)

Chains and convergence policy: lame() runs chains chains (default 2; options(lame.chains = k) sets another default). Chain \(k\) is seeded with seed + 1000 * (k - 1), so chains = 1 is the first chain of a two-chain fit. On Unix the chains run forked, on at most cores workers (all cores but one by default); on Windows they run one after the other. The draws do not depend on the number of workers. The result is the pooled fit of combine_ame_chains, with fit$chains, fit$chain_seeds, fit$rhat (the R-hat of each monitored series with its effective draws per split chain, pooled ess and of the least-mixing chain ess_chain, its threshold, whether the chains hold enough effective draws to be compared on it, informative, and how many that takes, ess_needed; ess and ess_chain count effective draws per split chain, half of one chain, while the ESS column of summary() is the total over all chains), the state each chain stopped in, and the chain_indicator that as_draws() and trace_plot use. Two chains cost twice the CPU time and about the same wall time on a multicore machine.

At the end of the post-burn run every chain is checked, and the chains are compared with each other. Within a chain, the first and last thirds of the stored draws of the intercept (or first coefficient), va, vb, ve, rho, rho_ab, sigma_ab, rho_uv, sigma_uv and pi_snap are compared with batch-means standard errors (ten batches per third); a quantity is flagged when the two means differ by more than half a posterior standard deviation of the whole series and by more standard errors than the drift threshold. Between chains, the split rank-normalised R-hat (Vehtari et al., 2021) of each series of the monitored set is compared with its threshold. Both thresholds are set so that chance alone flags settled chains anywhere in the fit with probability about 1 percent per check, however many quantities are checked. The chains are compared on a series only when they hold enough effective draws for its threshold to catch chains one posterior standard deviation apart at least 95 percent of the time; a series with fewer is flagged as having too few effective draws to compare (see Gate thresholds below). The monitored set is every regression coefficient (each period's under dynamic_beta), va, vb, cab, ve, rho, the dynamic hyperparameters, and summaries of the additive and latent structure recorded at every stored draw (the rms of a and b, the largest actor effect, the rms of the latent product \(UGV'\), the norm of G of a bipartite fit and the split of scale between U and V of a directed fit, per period for dynamic fits). The dyadic products are not monitored. Quantities a fit reports as not estimated are left out, and a run with fewer than 60 stored draws per chain is not checked (print() says so). The gate is computed on the draws the returned fit holds (the last block of every chain). fit$diagnostics$rhat, from compute_mcmc_diagnostics, is the same statistic of the same draws and equals fit$rhat for every monitored coefficient and variance component.

When a chain drifts, an R-hat exceeds its threshold or a series has too few effective draws to compare, every chain is extended by a block of sweeps from its own final state, as lame_resume does (the seeds advance by the sweeps already run); the flagged block counts as extra burn-in, its draws are discarded, and both checks run again. The block is nscan sweeps or, when series are short of effective draws, long enough for each to hold a quarter more than it needs at its autocorrelation (at most four times nscan; the stored draws grow with the block). Up to prior$chain_extensions extensions are made (default 3). The returned fit holds the draws of the last block, and fit$auto_extend records the extensions, the sweeps discarded, the length of the last block (block_nscan) and the quantities that triggered each. If a chain of the last block still drifts or an R-hat is still above its threshold (or the time under max_seconds ran out during an extension, or prior$chain_extensions is 0), lame() returns the fit with its draws and a warning of class lame_chain_unsettled that names the quantities still moving; fit$auto_extend$settled is FALSE, fit$auto_extend$moving lists them, fit$rhat holds the monitored table (R-hat, effective draws, threshold and verdict of every series), print() and summary() say that the chain had not settled, and lame_resume(fit, nscan = nscan) continues every chain. Inspect the traces or run longer before relying on such a fit. If the chains of the last block only hold too few effective draws on some series, the fit is returned with a warning of class lame_chain_not_compared that names them and the nscan that would be enough, and fit$rhat marks them informative = FALSE. prior = list(chain_extensions = 0) decides on the first block; chains = 1 runs one chain with the drift check only. No chain that still drifts, or an R-hat still above its threshold, after the last extension is returned with its draws.

Gate thresholds. Each quantity is tested on its own, so a fixed threshold flags settled chains more often the more quantities are monitored and the fewer effective draws they hold. Both checks therefore use thresholds for the whole fit at the family-wise level \(\alpha = 0.01\). With \(m\) tests, each is made at the Sidak level \(a = 1 - (1 - \alpha)^{1/m}\). The drift threshold is the two-sided \(a\) quantile of Student's t on the Welch degrees of freedom of the two batch-means errors, \(m\) counting every quantity of every chain, and never below 3. For R-hat, \(m\) is twice the number of compared series (bulk and tail R-hat). For \(K\) split chains of \(n\) draws holding \(e\) effective draws each (pooled over the chains, from the autocorrelation within each chain of the rank-normalised draws by Geyer's initial monotone sequence), settled chains have a squared split R-hat of about \((n - 1)/n \, (1 + F/(e - 1))\), with \(F\) distributed as \(F(K - 1, K(e - 1))\); the threshold of a series is the larger of 1.05 and this value at the \(1 - a\) quantile of \(F\). Two chains \(d\) posterior standard deviations apart make \(F\) noncentral, with noncentrality \(e d^2\). The chains are compared on a series when its threshold flags \(d = 1\) with probability at least 0.95, which takes about 35 effective draws per split chain with 12 compared series, 38 with 30 and 41 with 100, almost whatever the run length; the threshold of a compared series is then between 1.05 and about 1.09. A series with fewer effective draws is flagged as too few to compare, and one whose R-hat exceeds even the wider threshold of its effective draws as disagreeing. The pooled effective draws are those of the comparison (the difference of two chain means varies as for chains holding the harmonic mean of their effective draws), so one sticky chain beside a mixing one leaves too few. Chains constant on a series at different values have an infinite R-hat and are flagged; chains constant at one value pass. The threshold falls and the power rises with the effective draws, and at a fixed autocorrelation time with the run length, so settled chains are extended less often, and chains one standard deviation apart flagged at least 95 percent of the time, the more or the better mixing their draws.

A split chain of \(n\) stored draws holds at most \(n\) effective draws, so in a first block of 100 stored draws per chain (nscan = 2000, odens = 20) the chains can be compared only on series whose draws are nearly independent (an autocorrelation time up to about 1.3 stored draws, a lag-one autocorrelation of about 0.14 for an autoregressive series), and at the defaults (400 stored draws per chain) on series with an autocorrelation time up to about 5 (lag-one about 0.68); the longer extension blocks (up to four times as long) take these to about 4 and 17 stored draws (lag-one about 0.6 and 0.89). No comparison of two chains does much better: the z test of the difference of the chain means with the variance known needs 27 effective draws per split chain to find a one standard deviation separation 95 percent of the time at the family-wise level 1 percent over 30 series.

On 30 settled autoregressive series per fit, chance put an R-hat above its threshold on at most 0.5 percent of series at every lag-one autocorrelation from 0 to 0.95 and at 400 and 100 stored draws per chain; a fit of 400 stored draws per chain was extended for too few effective draws in 0 percent of fits up to 0.3, 2 percent at 0.5, 77 percent at 0.6 and every fit from 0.7, and one of 100 stored draws in every fit. A one standard deviation separation on one series was flagged in at least 98 percent of fits at every autocorrelation and length, and in at least 96 percent of those in which the chains could be compared.

Rerun with the seeds and settings of the release sweep (burn = 500, nscan = 2000, odens = 20, two chains) on 63 fits that the fixed thresholds had refused or extended, the gate refused none. 48 passed, every one after one or two longer blocks (100 stored draws per chain leave most series too few effective draws), with a largest R-hat of 1.056 and at least 39 effective draws per split chain. 15 were returned with too few effective draws on some series: all 8 fits whose directed scale split was left to the conditional updates (uv_split_move = FALSE; uv_split held 6 to 13 effective draws per split chain after four blocks) and 7 of the 11 snap fits (uv_rms and uv_split, 4 to 36). With the earlier thresholds the same draws gave 11 refusals, all among those 15 fits and one snap fit that passes once its chains run longer.

The dyadic products are left out because their largest R-hat crosses 1.05 on settled chains. A fit has about \(10^4\) of them, and on stationary chains of 17 simulated configurations with a latent product (68 two-chain blocks) the largest product R-hat of a block reached 1.055; settled ordinal directed fits with dynamic_uv crossed 1.05 in 2 of their 4 blocks, so a product gate at 1.05 would extend and refuse settled fits. A study that reports individual dyadic products, rather than fit$UVPM or the monitored summaries, keeps the position draws (posterior_opts = list(save_UV = TRUE)) and continues the chains with lame_resume() until the R-hat of every reported product is below 1.05.

Model Selection Guidelines: Use both dynamic_uv and dynamic_ab when:

  • Networks show clear temporal trends in density or clustering

  • Individual node behavior changes systematically over time

  • Community structure evolves (merging, splitting, drift)

Use only dynamic_uv when:

  • Latent structure/communities change but individual effects are stable

  • Focus is on evolving homophily or clustering patterns

  • Network shows structural reconfiguration over time

Use only dynamic_ab when:

  • Individual heterogeneity varies but overall structure is stable

  • Actors' activity/popularity changes over observation period

  • Focus is on individual-level temporal dynamics

Bipartite Network Models:

When mode="bipartite", the model handles rectangular adjacency matrices Y with dimensions n_A x n_B, where n_A and n_B represent the number of row and column nodes respectively.

Static Bipartite Case: The model uses separate latent factor matrices:

  • U: n_A x R_row matrix of row node latent positions

  • V: n_B x R_col matrix of column node latent positions

  • G: R_row x R_col interaction matrix mapping between latent spaces

  • Multiplicative term: U G V' captures bipartite community structure

Dynamic Bipartite Case: When dynamic_uv=TRUE for bipartite networks: $$U_{i,k,t} = \rho_{uv} U_{i,k,t-1} + \epsilon_{i,k,t}$$ $$V_{j,k,t} = \rho_{uv} V_{j,k,t-1} + \eta_{j,k,t}$$ where i indexes row nodes, j indexes column nodes, k indexes latent dimensions.

Every bipartite fit estimates a single interaction matrix and returns it as fit$G: with moving positions a per-period interaction matrix is not identified apart from them (\(U_t G_t V_t'\) and \((U_t G_t) V_t'\) describe the same products). Use dynamic_uv = TRUE for a time-varying multiplicative term and read the per-period product fit$UVPM, which is the identified quantity.

Key Differences from Unipartite Models:

  • No dyadic correlation (rho): Bipartite edges are inherently directed

  • Separate dimensions: R_row and R_col can differ for row/column spaces

  • Rectangular structure: Network density patterns differ from square matrices

  • Community interpretation: Captures affiliation patterns between node types

Missing covariates:

A cell whose dyadic covariate, sender (row) covariate or receiver (column) covariate is missing in its period is an unobserved tie, for unipartite and bipartite panels alike: it is set to NA in Y before the design is built, and the covariate coefficients are estimated from the complete cells. A message gives the number of such cells. A missing value is never modelled as 0, which would bias the coefficient of a covariate that is not centred. In a symmetric panel a dyad has one covariate value: a hole in one triangle of a dyadic covariate is filled from the other triangle (a message gives the number of values), so the slice stays symmetric and the dyad stays observed, and a dyad missing in both triangles is unobserved. A missing node covariate removes the actor's row and column in that period. A covariate that is missing in every period stops the fit. ame and the ALS routes apply the same rule and give the same messages.

Collinear covariates:

A regression design whose columns are aliased over the observed cells of the whole panel (a covariate that duplicates another, or one that is a linear combination of others, counting the intercept and the sender and receiver covariates), static or with dynamic_beta, is an error of class lame_design_rank. It names the aliased columns and the combination each equals: the data cannot separate their coefficients, so the posterior along that direction would be the prior's alone. The periods are pooled, so a covariate that duplicates another in some periods only is fitted, and period indicators that span the intercept still drop it, with the warning. A column is aliased when it is a combination of the columns before it to a relative 1.5e-7, the collinearity below which the cross products the coefficient updates work with keep fewer than two digits; a design that is only nearly collinear is fitted. method = "als" refuses the same designs with the same condition (fields aliased, rank and n_col) for every estimator and family.

Standard AME Model Types:

The following describes the six standard data types/models available:

"normal": A normal AME model.

"binary": A binary probit AME model.

"ordinal": An ordinal probit AME model. An intercept is not identifiable with data-induced cutpoints. Explicit cutpoints anchored at zero support an intercept.

"poisson": An overdispersed Poisson-lognormal model for counts (negative or non-integer observed values are an error): \(Y \sim \mathrm{Poisson}(e \exp(z))\) with \(z \sim N(\eta, \sigma^2)\). Given \(\eta\) and \(\sigma^2\), a cell's mean count is \(e \exp(\eta + \sigma^2/2)\). YPM, fitted() and predict(type = "response") report it, for the exposure \(e_t\) of the period (period_exposure; one without), at the posterior mean \(\eta\) of the linear predictor (EZ) and the posterior mean \(\sigma^2\) of the residual variance, the form the fast estimators report. Predictive quantiles and event probabilities come from posterior predictive draws (simulate(), predict(fit, h = 1, interval = "prediction")). Zero exposure gives a structural zero count.

Joint scale move (binary, unipartite and bipartite):

A probit panel identifies the scale of the linear predictor only weakly: a higher intercept with less spread in the additive effects and smaller latent positions fits a sparse panel nearly as well, so the level of the predictor and the spread of the effects trade off along a ridge. The conditional sweep cannot step along it, because conditioning on the latent \(Z\) pins the scale of every block, and a cold start can take many thousands of sweeps to arrive. Binary unipartite fits therefore carry a Metropolis step that multiplies the coefficients and additive effects by a factor \(c\) and the latent positions by \(\sqrt{c}\), with the variance parameters held fixed over the step and following it through their own draws. Under dynamic_ab the same visit walks a second direction: the per-period deviations of the additive effects together with \(\sigma_{ab}\), whose amplitude relative to that innovation scale is a ridge of its own (the deviation draw pins the deviations given \(\sigma_{ab}\) and its draw pins \(\sigma_{ab}\) given them). Moving the two together leaves their AR(1) prior invariant, so only the likelihood and the inverse-gamma prior on \(\sigma_{ab}^2\) resist; set prior$dev_move = FALSE to leave that direction out. The step integrates \(Z\) out (the dyad errors are split into a shared factor and an independent part; the factor is drawn from its conditional and the independent part integrated out), so it is accepted against the exact conditional posterior and leaves it unchanged; \(Z\) is redrawn from its conditional when the step is accepted. It is visited every prior$level_move_every sweeps (default 30) with prior$level_move_tries proposals per visit (default 8), adapts its step size during burn-in only, and reports its acceptance rate in fit$level_move. It is off for other families, symmetric fits and dynamic_rho. Changing coefficients with static factors are supported for ranks 1 and 2 when both actor margins and dynamic_ab are enabled, dcor = FALSE, and the coefficient law is AR(1) or RW1 on the regular grid, with zero initial means and diagonal innovation scaling. The static factor covariance is integrated in the acceptance density.

That configuration also receives a joint Hamiltonian update of coefficients, actor effects and factors with the binary latent responses integrated out. It requires at least three actors and one static coefficient. The update uses exact actor contrasts, keeps hyperparameters fixed, and adapts its step size during burn-in only. Bounded momentum kicks preserve reversal and phase-space volume; the Metropolis correction retains the original target. It runs every 20 sweeps; acceptance and numerical rejections are recorded in fit$marginal_move. Set prior$marginal_move = FALSE to omit this update. With static additive effects, an intercept, both actor margins and the same rank-one or rank-two changing-coefficient configuration, a joint observed-data update moves static actor contrasts, coefficients and factors. It integrates out the static factor covariance under its original prior. Bounded momentum updates and a Metropolis correction preserve the original target. The move begins after half of burn-in and runs every 20 sweeps; its step size adapts only during burn-in. Acceptance and numerical rejections are recorded in fit$marginal_move. Set prior$marginal_move = FALSE to omit this static-actor update.

Other changing-coefficient and static-factor configurations retain their existing updates.

Binary bipartite fits with an intercept, both margins, static coefficients and, when they have a multiplicative term, a static interaction matrix carry the same step on the whole predictor: the coefficients, the additive effects (and their deviations under dynamic_ab) and the interaction matrix \(G\) are multiplied by \(c\) with the latent positions held. The cells of a bipartite panel have no dyadic correlation, so no shared factor is drawn, and the prior terms of every block the factor touches (the coefficient prior, the effects, their AR(1) deviations, the \(N(0, 1)\) prior of the entries of \(G\) cut at prior$G_max) are included in the acceptance ratio.

Binary unipartite fits (directed or symmetric, with any additive margin in the model, and with static coefficients or dynamic_beta of kind "ar1" or "rw1") also receive a collapsed per-actor update. The data-augmentation sweep draws an actor's parameters from a normal whose precision is the number of cells the actor appears in, so an actor whose cells hold no events (a flat likelihood on a half line) moves by about \(1/\sqrt{m}\) per sweep however wide its posterior is, and relaxes in about \(v m\) sweeps: thousands of sweeps for the additive level of an inactive actor, and \(10^5\) for static positions that have spread out, because the positions also feed the factor covariance they are drawn under. The update integrates the latent array out (as the scale move does) and draws, one actor at a time, an exact elliptical slice step of the actor's sender and receiver level translations and, for static positions, of its sender and receiver positions. The level translation adds a constant to one actor's predictor while the other levels and the intercept absorb the re-centring, so it keeps the sum-to-zero constraint and touches one row (or column) of the likelihood. The latent array is redrawn afterwards, so the posterior is unchanged; there is nothing to tune. It is available for dynamic_ab and static effects, ranks 0 to any with static positions (positions that move over time keep their own updates; only the levels are moved), and is visited every prior$actor_move_every sweeps (default 10). The positions are left to the sampler during the first half of burn-in, when it runs under a fixed diffuse prior that lets the positions of actors without information take any scale. In a symmetric fit an actor has one level, which enters both its row and its column, and the positions are those of the eigenmodel (\(u_i\) with the diagonal weights held fixed during the visit, drawn under the sampler's own precision prior); there is no dyadic correlation. Panels with absent actors (changing composition) are covered: only observed cells enter a likelihood, an actor with no observed cell in a block has the prior as its conditional there and the slice step moves it across that prior, the translation moves the level of absent periods with the rest, and the missing cells are redrawn from the model afterwards, as the sampler does. Set prior$actor_move = FALSE to omit it; its work is recorded in fit$actor_move. For directed fits with dcor = TRUE the same visit also updates the dyadic correlation with both latent responses of each dyad integrated out (an independent proposal from its \(1 - \rho^2\) prior, accepted on the exact pair likelihood, followed by an exact redraw of the latent array), because given the augmented array the correlation moves by about \(1/\sqrt{\mathrm{dyads}}\) and mixes slowly when few dyads are mutual; prior$actor_move_rho = FALSE omits that part.

The Poisson and ordinal families have the same slow direction, and the latent array cannot be integrated out, so their update carries it along: an actor's level is translated together with the latent values of its row (its column, or the pairs of a symmetric network), which leaves every residual, hence the Gaussian density of the latent array, unchanged. The shift is then an exact draw from the level prior (with the intercept that absorbs the re-centring) times the data factor of the row: the log-concave Poisson factor of the observed cells (an elliptical slice step) or, for the ordinal family, the indicator that the shifted values keep their ranks (or stay inside their cutpoint intervals), which cuts the prior at both ends and is drawn as a truncated normal. The intercept, the spread of the levels and the levels of the inactive actors, which the sweep alone crosses over thousands of sweeps on a sparse panel, then mix within a few visits. With static coefficients the Poisson family also translates each coefficient with the latent array, and moves the dyadic variance and the dyadic correlation together with the latent residuals (a Metropolis step whose ratio is the change of the Poisson factor and the priors), because given the array the residuals are prior draws wherever the counts say little, and, with static positions, redraws each actor's position with the latent values of its row or column carried along (an elliptical slice step under the factor prior the sampler draws under; the positions are left to the sampler during the first half of burn-in, when it runs under a fixed diffuse prior); the ordinal family draws the location of the latent array (the means of the levels, or the intercept), which the rank likelihood leaves free and explicit cutpoints confine to a strip. Visits are every prior$actor_move_every sweeps (default 10).

With moving positions (dynamic_uv = TRUE with a positive rank, of the "ar1" and "snap" kinds, or the "t" kind of a directed network) the sweep moves the position path of an actor whose cells say little (no events, or absent from most periods) by a step of about \(\sqrt{s_2 / m}\) per sweep, \(m\) the number of its cells, however wide the posterior of the path is (\(s_2\) is the dyadic variance, near 0.05 for a sparse Poisson panel and 1 for the probit families). The paths of such actors then wander at no likelihood cost, and the squared product of the positions, the persistence and innovation scale of the paths and the intercept follow them with autocorrelation times of hundreds to thousands of sweeps. Every prior$actor_move_every sweeps the update therefore redraws each actor's whole path, the senders' and then the receivers' (a symmetric network's once), with one elliptical slice step under the AR(1) prior of the path (stationary start; the local innovation scales of the "t" kind), the persistence and the innovation scale being held. For the Poisson family the latent values of the actor's row or column are moved with the predictor, which changes no residual, so the conditional of the path is its prior times the Poisson factor of the cells. For the binary family the latent array is integrated out as in the collapsed update above (the shared dyad factor of a directed network is drawn once per visit, each observed cell contributes a probit factor, and the latent array is redrawn at the end). Bipartite fits use their interaction matrix and symmetric fits the signed weights of their unit-variance coordinate paths. A directed binary fit with dynamic_ab at rank two already has the paired-actor slice step described below and is left to it; ordinal fits keep the sampler's own updates. Under the "snap" kind every family takes a compiled visit of the paths (every sweep; Poisson fits with their translations): binary and Poisson fits with the factors above, the normal and ordinal families with the latent array held and the Gaussian density of each latent cell given its reciprocal partner (bipartite and symmetric cells have none; a symmetric actor's line holds each of its pairs once, and the visit moves both triangles and the diagonal). A bipartite fit visits its row and then its column paths, each with its own resets, through \(G\); a symmetric fit visits its one set of unit-variance paths through their weights. Each path takes five exact steps given the rest of the state. Its prior with the resets summed out is \(N(x_1; 0, \sigma^2 / (1 - \rho^2) I) \prod_t m(x_t \mid x_{t-1})\), \(m(x_t \mid x_{t-1}) = (1 - \pi) N(\rho x_{t-1}, \sigma^2 I) + \pi N(0, \kappa^2 I)\): (1) a slice step under a Gaussian reference prior, the AR(1) path or with equal chance the path that resets at one later period, whose likelihood is the factor of the cells times the ratio of the two priors, so the step can open or close a reset; (2) Metropolis steps on \(\log c\) for \(x_s \to c x_s\), \(s \ge t_0\) with \(t_0\) drawn at random, with the Jacobian \(c^{R (N - t_0 + 1)}\), which crosses the width of a reset position; (3) the resets given the path; (4) a slice step given the resets; (5) the resets again. The sampler's own update draws an actor's reset and position for one period at a time given the latent array and the neighbouring periods, so on its own it rarely passes between a reset and a drift explanation of a period change. Given the resets the prior of the paths is Gaussian, with each reset position entering the moments of the paths at weight \(\sigma^2 / \kappa^2\) and no transition from the period before, so the exact gauge moves of bipartite and symmetric paths (the scale split, the common gauge against \(G\), the split of a symmetric column against its weight, the period signs and the signs along the singular directions of \(G\)) read those moments, and the persistence of symmetric paths is drawn from their drifting transitions alone (the first period and, under the linked scale of 1, a reset position do not depend on it). A symmetric "ar1" Poisson or binary fit also draws, every sweep, the scale ridge between its coordinate paths and their weights (scaling a coordinate of every path by \(c\) and its weight by \(1/c^2\) changes no cell of the predictor, so the draw is a Metropolis step on \(\log c\) with the ratio of the priors; it is recorded as dpm_scale_attempts and dpm_scale_accepts) and draws the persistence rho_uv with a proposal scale taken from the transitions of the paths, where the fixed scale of the sampler's own draw is 10 to 90 times the width of the conditional at persistences from 0.9 to 0.985 and moves rho_uv in one call of every ten to ninety. prior$actor_move_paths = FALSE omits this part only.

With dynamic_beta the prior of the intercept enters the density of a level translation through its path: the translation moves the whole path by the same constant, which changes the prior of the first state and, unless the path is a random walk, of the transitions. A static intercept next to moving coefficients enters through its own prior, and moving coefficients other than the intercept are not touched. A fit with no additive margin (rvar = cvar = FALSE, or a symmetric fit with nvar = FALSE) and static positions runs the position steps alone, and a fit with one margin translates the levels of that margin. Coefficient paths of the other kinds ("rw2", "matern32") or on a non-unit period grid keep their own updates.

The same update runs for bipartite binary fits (and in ame for a bipartite cross-section): each row and column actor's level translation, which moves the intercept with it and touches one row or column of the likelihood, and, for static positions, its position, as exact elliptical slice draws with the latent array integrated out; under dynamic_ab it also draws the deviation paths of random pairs of actors of a margin with their sum held. A bipartite cell has no partner cell, so there is no reciprocity update, and the positions have a fixed unit-variance prior, so there is no factor covariance to draw. Missing cells and the cells of an actor absent from a period carry no likelihood, and the update is never switched off by missingness. With dynamic_beta of kind "ar1" or "rw1" on the unit period grid the translation moves the whole intercept path by the same constant (a static intercept next to moving coefficients by the same amount), and the prior of the intercept enters the density of the translation through its path, as for unipartite fits.

A "poisson" fit translates the coefficients that move as well. The counts of a period fix the log of its mean to about \(1/\sqrt{\mathrm{events}}\), while given the latent array the intercept of the period is known to \(\sqrt{s^2/\mathrm{cells}}\), 10 to 20 times less on a sparse panel (0.015 to 0.022 against 0.0012 at 170 actors); the sweep moved the intercepts of the periods, and with them the coefficient of a dyadic covariate and the dyadic variance and correlation, by random walk. The gate panel of 170 actors and four periods had 3 to 14 effective draws of the period intercepts in 1,600 (split R-hat 1.5), 6 of the covariate coefficient, 6 of the correlation and 16 of the variance. Raising coefficient \(k\) of one period by \(\delta\) and the latent values of the period by \(\delta x_{kt}\) leaves every residual unchanged, so the shift is an exact draw (an elliptical slice step) from the prior of the shifted path times the log-concave Poisson factor of the period's cells. The prior is the one of the path's kind ("ar1", "rw1", "rw2", "matern32", on any time grid), read from the precision the path sampler uses. The whole path of a coefficient is translated the same way, and so are the static coefficients next to moving ones, with the latent array of every period, at the visits of the translations of the actor levels (prior$poisson_period_move = FALSE and prior$poisson_static_move = FALSE omit them). Those fits, and every other "poisson" fit without dynamic_rho, then move the dyadic variance and correlation at every sweep with the latent residuals carried along their conditional law: given the counts the residuals of a dyad are close to a Gaussian with mean \(m\) and covariance \(V\) (the Gaussian prior times the first-order terms of the Poisson factors), the move maps \(e' = m' + L'L^{-1}(e - m)\) for a proposed variance and correlation, and accepts with the Metropolis ratio of the joint density (the change of the Poisson factors, of the Gaussian density and the Jacobian of the map). The residuals of the cells with a count are tilted by about \(s^2 (y - \lambda)\), which follows the variance and not its square root, so scaling them as the translations of the actor levels do accepts steps of a few hundredths in the log variance, and this map accepts steps of 0.1 to 0.8. The visits of the translations of the actor levels are every second sweep for the Poisson family (every tenth left the least active actors with 30 to 80 effective draws of 2,000); fit$poisson_period_move records the moves. On the gate panel the period intercepts then have 1,370 to 1,450 effective draws of 1,600, the covariate coefficient 1,320, the correlation 650, the variance 850 and the slowest actor effect 400, and the split R-hat is 1.006; a sweep takes about a third longer.

An "ordinal" fit draws the scale of its latent array along the transformations that keep every rank. With the default data-induced cutpoints a cell of the latent array is drawn between the extreme values of the neighbouring categories, and those extremes are order statistics of thousands of cells: they move by steps of \(1/\mathrm{cells}\) per sweep, while the scale of the whole configuration (the spread of the implied cutpoints against the unit residual variance) has a posterior of width \(1/\sqrt{\mathrm{cells}}\), and given the latent array the coefficients, the additive effects and the dyadic correlation are tied to it. On 150 actors the coefficient of a dyadic covariate had 8 effective draws of 600 and the correlation 95; on 100 actors in four periods, whose rank windows are separate, 3 of 400 and 3. Multiplying the latent array, the coefficients and the static additive effects by a factor \(c\) keeps every rank, and \(c\) has an exact conditional (a group move whose invariant measure is \(dc/c\): a gamma draw when the priors have mean zero and the predictor is fully scaled, an independence Metropolis step from its Laplace approximation otherwise). The shift and the scale of the latent array of each period alone keep that period's ranks and have exact conditionals too. Both are drawn at every sweep, and the same panels then have 600 and 400 effective draws of the coefficient and 400 and 270 of the correlation. The multiplicative effects, the dynamic additive effects and the dynamic positions stay unscaled parts of the predictor: the moves stay exact, and their efficiency is the share of the signal they scale. With explicit cutpoints the scale of the whole state carries the free cutpoints with it; the cutpoints of a directed fit with dcor = TRUE are drawn given the latent array, and on 50 actors the coefficient had 56 effective draws of 500 and the correlation 47, now 440 and 290 (prior$ordinal_scale_move = FALSE omits the moves; fit$ordinal_scale_move records them).

A "binary" fit draws the scale of its linear predictor with the latent array integrated out. When a covariate separates the ties (every tie lies above every non-tie on it) the likelihood increases without a bound along the ray that multiplies the coefficients and the additive effects by a factor \(c > 1\), and the posterior of the coefficient is its prior times a likelihood that saturates only where the dyads nearest the boundary are classified. The data-augmentation sweep draws every block given the latent array and crosses that direction by steps of \(1/\sqrt{\mathrm{cells}}\): on a 30-actor directed panel the separating coefficient had 12 effective draws of 2,000 (steps of 0.03 against a posterior sd of 0.6), and on a bipartite panel, whose coefficients have the independent prior \(N(0, g)\) with \(g\) the number of cells, it was still climbing after 8,000 sweeps (14.0 and 15.6 for two seeds, against a posterior mean of 59). Every prior$binary_scale_every-th sweep (default 5) the coefficients and the static additive effects are therefore multiplied by a factor drawn exactly from its conditional density, a group move whose invariant measure is \(dc/c\): the dyad errors of a directed network are split into a shared factor, drawn from its conditional given the latent array, and independent parts that are integrated out, so that each cell contributes one probit factor, and the latent array is redrawn from its conditional afterwards (the device of the collapsed actor updates). The multiplicative effects, the dynamic additive effects and the actor-specific slopes stay where they are and the draw stays exact; its efficiency is the share of the signal it scales. The same panels then have 460 and 140 effective draws of 2,000 after 8,000 sweeps, two seeds agree, and the posterior mean is the same at 2,000, 8,000 and 32,000 sweeps. The draw runs in every binary configuration of ame() and lame() except dynamic_rho, next to the joint scale move and the Hamiltonian updates described above where those run: in the Hamiltonian configuration (changing coefficients and effects, rank one) the separating coefficient had 16 to 20 effective draws of 2,000 after 8,000 sweeps (the two seeds agreed on its mean to within the Monte Carlo error) and now has 1,000 to 1,200, and in the static directed configuration 140 to 200 and now 630 to 910. prior$binary_scale_move = FALSE omits it; fit$binary_scale_move records it.

The actor-period effects of a "poisson" fit with dynamic_ab are moved together with the latent values of their rows and columns. Given the latent array an effect has the precision of the cells it touches over the residual variance, so a Poisson panel of sparse counts moved the effects, and with them the innovation scale sigma_ab, the persistence and the levels, by small steps (on 50 actors in five periods sigma_ab had 6 to 34 effective draws of 800 and the effects of the first and last period, whose paths have one neighbour, R-hat up to 1.34). Each sweep moves an effect and the latent values of its row by one amount, the cell residuals staying where they are, so that the conditional is the prior of the effect given its neighbours and level times a Poisson factor that is two sums per row; the draw is an elliptical slice step, and with an intercept the effects of a period are moved in pairs, which keeps their sum. sigma_ab then has 216 to 311 effective draws (prior$ab_period_move = FALSE omits the move; fit$ab_period_move records it).

Under dynamic_ab (every family; bipartite, directed and symmetric unipartite networks) the effect of an actor in a period is a level plus a stationary AR(1) deviation, and the likelihood sees only their sum, so a short or sparse panel splits the common variance of the effects between the level variance and a persistent deviation almost freely, and the sweep, which draws the levels given the hyperparameters and the hyperparameters given the levels, crosses that ridge only over thousands of sweeps. Each sweep therefore draws the level variances (for a directed network their covariance, the pair of an actor's levels being correlated), the innovation scale and the persistence from their density given the totals, with the levels integrated out, before the levels are redrawn from their conditional. The update uses only the totals, so it needs no latent array and does not depend on the family, leaves the posterior unchanged and is recorded in fit$ab_hyper_move; prior$ab_hyper_move = FALSE omits it and prior$ab_hyper_move_tries sets the proposals per sweep (default 8). For bipartite fits with static positions the scale of the positions trades against the scale of the interaction matrix, which the unit priors anchor weakly. Each sweep also draws, exactly from its conditional, the factors by which the columns of the positions and the rows and columns of the interaction matrix are rescaled, and the shears between columns of a side (each a Gaussian draw), without changing their product (recorded in fit$uv_g_scale_move; prior$uv_g_scale_move = FALSE omits it).

Directed binary panels with rank-two Gaussian AR(1) position paths, dynamic additive effects, static coefficients, an intercept, both actor margins and the default unit period grid also receive joint Hamiltonian updates. These integrate both binary latent responses out and retain the full reciprocal-pair likelihood. Factor persistence and stationary scale move in the same Hamiltonian trajectory as their whitened paths, with their original priors and transformation Jacobians retained. The metric uses fixed prior references rather than either proposed endpoint. Additional updates move persistence with path scales, translate factors while integrating and redrawing actor levels, and update dyadic correlation with the latent responses integrated out. Hamiltonian step sizes adapt during burn-in only and survive checkpoints. Set prior$marginal_move = FALSE to disable this group. Other configurations retain their existing updates. These moves preserve the posterior target.

A directed unipartite dynamic_uv fit of the "ar1" or "t" kind with a normal, Poisson or binary outcome starts its chain from a dynamic AR(1) ALS fit of the same model, mapped through als_start_vals, unless start_vals is supplied or prior$als_start = FALSE. Bipartite fits keep the cold start: a bipartite ALS solution parks its scale in the interaction matrix. An ALS start places the initial path on the observed temporal structure; the chain then samples the paths and hyperparameters from there. The ALS fit is deterministic, so the start does not depend on seed; it is an internal penalised point estimate, not the empirical-Bayes fit that method = "als" returns. A start fit that is refused as unconverged (class "lame_als_convergence") contributes its last iterate; a start with non-finite values, or positions beyond prior$uv_max_abs, is not used. fit$als_start records whether it was used.

Dynamic fast fits

A normal, binary or Poisson fit with method = "als" and dynamic_ab, dynamic_beta or dynamic_uv (of the "ar1" or "t" kind, with static or moving latent positions) is fitted by the dynamic empirical-Bayes estimator of the model lame() samples: the actor levels and zero-mean AR(1) deviation paths are random effects and the coefficients have a Gaussian prior; the variance of the cell-level noise (normal and Poisson) and the covariance of the actor levels are estimated by EM under the lame() hyperpriors; the persistences of the moving coefficients (fit$rho_beta) are set by EM too, as smoothing settings chosen by the fit rather than estimates; the persistence, innovation sd and stationary variance of the additive paths (fit$eb$ab_dynamics) and of moving positions (fit$eb$uv_dynamics) are estimates under the lame() hyperprior, without standard errors, only when the data carry enough signal to determine them (estimated = TRUE; the signal statistic is the data share of the information about the persistence for the effects and the product signal per loading for the positions, with the threshold in the record); otherwise they are working values of the fast route's search, print() and summary() say so and do not show them as estimates, and method = "mcmc" estimates them; als_start_vals() starts the sampler at them either way; the innovation scales of moving coefficients (fit$sigma_beta) are estimated by EM with standard errors; the coefficients have Laplace standard errors (vcov(), confint(), fit$eb$se, fit$eb$se_path for moving coefficients; exact for a normal response); the additive effects, their paths and levels have posterior standard deviations (fit$a_sd, fit$b_sd, fit$a_dynamic_sd, fit$b_dynamic_sd, fit$a_level_sd, fit$b_level_sd), the variance components and the innovation scales of the moving coefficients standard errors by Louis' identity (fit$eb$vc_se, fit$eb$hyper_se), and the cells of the latent product posterior standard deviations (fit$UVPM_sd); summary() shows them with 95 percent intervals. A binary fit with static factors whose signal does not reproduce a static intercept fits the intercept as an rw1 path (fit$eb$intercept_path). A static product is reported at mean zero, its grand mean (and its variance) carried by the intercept; a product below the information threshold is reported with its cell errors (fit$eb$product_weak); a fit whose equations are certified when the passes run out is returned (fit$eb$iteration_limit); static factors are the variational posterior of ame_als() (options(lame.eb_scale) selects the rule that sets the scale of their prior, "cavity" by default) and moving positions have a mean-field Gaussian posterior whose product uncertainty is carried through the cell likelihood; and a directed panel gets the dyadic correlation (dcor).

A normal response has an exact Gaussian cell: the posterior of the coefficients, the levels and the paths at the hyperparameters is exact, the standard errors are the marginal ones given the hyperparameters, the dyadic correlation is an exact bivariate normal pair, and the reported intercept is the level of the effects centred over the actors in each period, as in the samplers. A Poisson response is the Poisson-lognormal model: the correlation of a directed panel is taken at the fitted state, with the information of the pairs in the standard errors; the paths and levels are reported at their first-order posterior mean, the linear predictor (EZ) and the intercept are on the latent scale, and fitted() and predict() return exp(EZ + ve / 2).

A dynamic fit whose position-scale search ends at the smallest scale searched (the positions carry nothing the panel resolves) retires to rank R - 1, as the static route retires a column (a message of class "lame_als_retirement"; fit$R_requested and fit$eb$retirement); one whose objective keeps falling to the largest scale searched (the positions reproduce the panel) is returned at that scale with a warning of class "lame_als_unsettled" that counts the cells fitted with probability 1. A dynamic fit that did not meet its convergence criterion is returned with the same warning (see als_max_iter).

See also

ame for cross-sectional models, lame_als for the fast MCMC-free empirical-Bayes fit, als_dynamic_beta for a regression-only penalised smoother on the time-varying coefficient path, lame_resume for resuming saved checkpoints, gof for post-hoc goodness-of-fit computation, gof_plot for visualizing GOF results, latent_positions for extracting latent positions as a tidy data frame, procrustes_align for Procrustes alignment of latent positions, summary.lame for model summaries, coef.lame for coefficient extraction. Long-format edgelists and covariates can be prepared with netify::netify() and passed directly to lame(), or converted explicitly with netify::to_lame(lame = TRUE).

Author

Cassy Dorff, Shahryar Minhas, Tosin Salau

Examples


data(YX_bin_list)
# chains = 1 keeps the example short; the default runs two chains and compares them
fit<-lame(lapply(YX_bin_list$Y, function(y) 1 * (y > 0)), YX_bin_list$X,
          burn=5, nscan=5, odens=1, family="binary", chains = 1)
# you should run the Markov chain much longer than this

# \donttest{
## Time-varying regression coefficients (dynamic_beta).
## Make every dyadic coefficient evolve as a random walk:
fit_dyn <- lame(lapply(YX_bin_list$Y, function(y) 1 * (y > 0)), YX_bin_list$X,
                family = "binary", R = 0,
                nscan = 60, burn = 15, odens = 5,
                dynamic_beta = "dyad", dynamic_beta_kind = "rw1", chains = 1)
dim(fit_dyn$BETA)        # [n_stored, p, T] -- 3-D when dynamic
#> [1] 12  4  4
coef(fit_dyn)            # [p, T] posterior-mean coefficient paths
#>                  t1        t2        t3        t4
#> intercept 0.1135486 0.1135486 0.1135486 0.1135486
#> X1_dyad   0.7548854 0.7416379 0.7384587 0.7338013
#> X2_dyad   0.9207122 0.9106129 0.8937116 0.8836146
#> X3_dyad   1.1248090 1.1324497 1.1361538 1.1008430
confint(fit_dyn)         # per-period 95% credible intervals
#>                     2.5%     97.5%
#> intercept[t1] 0.07070182 0.1675668
#> X1_dyad[t1]   0.70381561 0.7864331
#> X2_dyad[t1]   0.87701376 0.9469334
#> X3_dyad[t1]   1.05508119 1.1771893
#> intercept[t2] 0.07070182 0.1675668
#> X1_dyad[t2]   0.71668275 0.7662140
#> X2_dyad[t2]   0.87445189 0.9436476
#> X3_dyad[t2]   1.08438235 1.1910175
#> intercept[t3] 0.07070182 0.1675668
#> X1_dyad[t3]   0.69591361 0.7732797
#> X2_dyad[t3]   0.86627807 0.9124105
#> X3_dyad[t3]   1.09664831 1.1690478
#> intercept[t4] 0.07070182 0.1675668
#> X1_dyad[t4]   0.70416530 0.7688514
#> X2_dyad[t4]   0.84033441 0.9183388
#> X3_dyad[t4]   1.05980395 1.1313402
summary(fit_dyn)         # prints a "Dynamic coefficients per period" block
#> 
#> ── Longitudinal AME model summary ──────────────────────────────────────────────
#> 
#> ── Call 
#> Y ~ dyad(X1, X2, X3) + a[i] + b[j] + rho*e[ji], family = 'binary'
#> 
#> ── Model 
#> • Time periods: 4
#> • Family: binary
#> • Mode: unipartite
#> • Dynamic regression coefficients: enabled (kind = rw1)
#> 
#> ── Regression coefficients 
#>           Estimate StdError z_value p_value CI_lower CI_upper    
#> intercept    0.114    0.032   3.505       0    0.071    0.168 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> ℹ Stars are a visual hint from the posterior mean / SD only; for inference use
#>   the credible intervals.
#> 
#> ── Coefficient paths 
#>         Estimate StdError CI_lower CI_upper
#> X1_dyad    0.742    0.021    0.712    0.771
#> X2_dyad    0.902    0.019    0.872    0.925
#> X3_dyad    1.124    0.029    1.076    1.163
#> ℹ X1_dyad, X2_dyad, and X3_dyad are coefficient paths: the row gives the mean
#>   level over the periods and its interval; R-hat is the largest and ESS the
#>   smallest over the periods. The periods are below.
#> 
#> ── Dynamic coefficients per period 
#>            Mean   Min   Max Drift Drift_pct Dynamic
#> intercept 0.114 0.114 0.114 0.000     0.000       N
#> X1_dyad   0.742 0.734 0.755 0.021     2.841       Y
#> X2_dyad   0.902 0.884 0.921 0.037     4.112       Y
#> X3_dyad   1.124 1.101 1.136 0.035     3.143       Y
#> 
#> ── X1_dyad by period 
#>    Estimate StdError CI_lower CI_upper
#> t1    0.755    0.029    0.704    0.786
#> t2    0.742    0.018    0.717    0.766
#> t3    0.738    0.026    0.696    0.773
#> t4    0.734    0.022    0.704    0.769
#> 
#> ── X2_dyad by period 
#>    Estimate StdError CI_lower CI_upper
#> t1    0.921    0.025    0.877    0.947
#> t2    0.911    0.025    0.874    0.944
#> t3    0.894    0.014    0.866    0.912
#> t4    0.884    0.026    0.840    0.918
#> 
#> ── X3_dyad by period 
#>    Estimate StdError CI_lower CI_upper
#> t1    1.125    0.042    1.055    1.177
#> t2    1.132    0.035    1.084    1.191
#> t3    1.136    0.024    1.097    1.169
#> t4    1.101    0.023    1.060    1.131
#> 
#> ── Variance components 
#>     Estimate StdError
#> va     0.538    0.095
#> cab    0.249    0.067
#> vb     0.437    0.077
#> rho    0.247    0.088
#>   va = sender variance, cab = sender-receiver covariance, vb = receiver
#>   variance, rho = dyadic correlation
# }