netify_to_lame() (also available as to_lame()) is a thin
specialization of \link{netify_to_amen} for the sibling lame
package, which is not on CRAN. Install from GitHub:
remotes::install_github("netify-dev/lame").
lame::ame() accepts the same
Y / Xdyad / Xrow / Xcol skeleton as amen::ame() but adds
two things netify users care about:
Arguments
- netlet
A netify object.
- lame
Logical. As in
netify_to_amen: passTRUEwhen actor composition varies over time. DefaultFALSE.- family
Optional character. AME family to use. If
NULL(default), inferred from the netify:"binary"for binary networks,"normal"for weighted, with a once-per-session info message naming the choice.- pad
Logical. When
lame = TRUEand the per-period list is returned (the function never actually pads in place; it always returns a list), controls whether the once-per-session info message points users at thelame::list_to_array()+lame::lame()snippet baked intonl$ame_call. DefaultTRUE(emit the message); setFALSEto silence it.- fit_method
One of
"gibbs"(default — MCMC posterior vialame::ame()/lame::lame()) or"als"(fast alternating- least-squares point estimate vialame::ame_als()). For bipartite + binary networks where MCMC is slow, ALS withbootstrap > 0gives a fast point estimate plus parametric/block bootstrap uncertainty intervals in a single call. The choice only affects the generatedame_callsnippet — theY/Xdyad/Xrow/Xcolpayload is identical.- bootstrap
Integer. Number of bootstrap replicates for ALS uncertainty intervals. Ignored when
fit_method = "gibbs"(MCMC draws ARE the uncertainty representation there). Default0(no bootstrap). Pass200for a reasonable interval estimate.
Value
A list with the same shape as netify_to_amen
output, plus two helpful extras:
modeCharacter:
"unipartite"or"bipartite". Pass this directly tolame::ame(mode = .).familyCharacter: the suggested family (
"binary"or"normal"). Pass tolame::ame(family = .).ame_callCharacter: a literal
lame::ame()call string the user can copy-paste.
Details
rectangular
Yfor bipartite networks viamode = "bipartite"— the standardamen::ame()rejects this.ragged longitudinal panels via
lame::list_to_array()→lame::ame_rep_*—amenrequires constant actor composition.
This function wraps \link{netify_to_amen} and:
picks a
familydefault appropriate to the netify ("binary"for binary nets,"normal"for weighted),suggests the correct
modeargument forlame::ame()("unipartite"/"bipartite"),for
lame = TRUElongitudinal output, emits a copy-pastelame::list_to_array()+lame::lame()snippet in the returnedame_callslot. The function itself does not pad the list — run the snippet (or the literal call) to do that step yourself.
Bipartite + binary: the case to_amen() cannot fit.
For a bipartite weighted-binary netify (e.g., person × event
attendance, 0/1), this is the exact pipeline:
bp <- netify(df, actor1 = "person", actor2 = "event",
mode = "bipartite", weight = "attended")
nl <- to_lame(bp) # auto-detects binary
fit <- lame::ame(
Y = nl$Y, Xrow = nl$Xrow, Xcol = nl$Xcol,
mode = nl$mode, family = nl$family,
nscan = 1000, burn = 500
)
# uncertainty: posterior intervals are in fit$BETA / fit$VCRagged longitudinal panels. When lame = TRUE and
actors enter / exit the network, this function:
builds the per-period list via
netify_to_amen(lame=TRUE),bakes a
lame::list_to_array(actors = U, Y = nl$Y, ...)pad-then-fit snippet intonl$ame_callthat the user runs to materialize the 3D[n, n, T]array and fitlame::lame().
The returned Y / Xdyad / Xrow / Xcol are always the
per-period list — pad only controls whether the once-per-
session info message reminding the user of the snippet fires.
See also
netify_to_amen (the underlying converter),
netify_to_statnet, netify_to_dbn,
netify_to_igraph.