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 the padding +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 a generated padding snippet –
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-paste padding +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 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 pad-then-fit snippet into
nl$ame_callthat the user runs to materialize the 3d[n, n, t]array and fitlame::lame(). unipartite snippets uselame::list_to_array(); bipartite snippets pad rectangular row-by-column arrays directly.
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.