netify_to_lame() (also available as to_lame()) is a thin
specialization of \link{netify_to_amen} for the optional lame
workflow. 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::lame()call 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 (cross-sectional) orlame::lame()snippet (longitudinal) the user can copy-paste.
Details
rectangular
yfor bipartite networks viamode = "bipartite"– the standardamen::ame()rejects this.ragged longitudinal panels via
lame::lame(), which aligns per-period actor sets by name –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 longitudinal output, emits a copy-paste
lame::lame()call in the returnedame_callslot. withlame = TRUEthe per-period lists are passed directly; withlame = FALSEthe snippet first splits the[n, n, t]arrays into the per-period lists thatlame::lame()expects.
bipartite + binary: the case to_amen() cannot fit.
for a bipartite weighted-binary netify (e.g., person x 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::lame()call intonl$ame_callthat passes the per-period lists directly;lame::lame()aligns actors across periods by name, for unipartite and bipartite networks.
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.