Obtain one big LSMI -- with max(n.seeds)
seeds and n.wave
waves around each -- and subsample seeds to create smaller LSMIs (with less
seeds and/or waves). The function is primarily used in cross-validation.
lsmi_union(net, n.seeds, n.wave, seeds = NULL)
a network object that is a list containing:
degree
the degree sequence of the network, which is
an integer
vector of length \(n\);
edges
the edgelist, which is a two-column matrix, where each row is an edge of the network;
n
the network order (i.e., number of nodes in the network).
The network object can be simulated by random_network
,
selected from the networks available in artificial_networks
,
converged from an igraph
object with igraph_to_network
,
etc.
an integer vector of numbers of seeds for snowball sampling
(cf. a single integer n.seed
in lsmi
). Only
n.seeds <= n
are retained. If seeds
is
specified, only values n.seeds < length(unique(seeds))
are retained
and automatically supplemented by length(unique(seeds))
.
an integer defining the number of waves (order of the neighborhood)
to be recorded around the seed in the LSMI. For example, n.wave = 1
corresponds to
an LSMI with the seed and its first neighbors. Note that the algorithm allows for
multiple inclusions.
a vector of numeric IDs of pre-specified seeds. If specified, LSMIs are constructed around each such seed.
A list with two elements:
LSMI with max(n.seeds)
seeds (see the argument definition
above) and n.wave
waves produced by the lsmi
function.
A list of length equal to length(n.seeds)
;
each element of the list is a random subset of the seeds' IDs, starting from
the largest (a set of size max(n.seeds)
) to the smallest
(a set of size min(n.seeds)
).
Note that the produced LSMIs are slightly different from those described by gel_etal_2017;textualsnowboot. The current R implementation produces smaller LSMIs by subsetting the seeds, not by new sampling of seeds from the network and growing completely new LSMIs, as it was done by gel_etal_2017;textualsnowboot. See the details in Figure 3 by chen_etal_2018_snowboot;textualsnowboot
# NOT RUN {
net <- artificial_networks[[1]]
a <- lsmi_union(net, n.seeds = c(5, 10, 15), n.wave = 2)
# }
Run the code above in your browser using DataLab