Performs a group-scan sampling over a scanList object Internal.

group_sample(
  scan.list,
  sampling = c("constant", "matrix", "random", "function"),
  all.sampled = TRUE
)

Arguments

scan.list

a scanList object

sampling

for method = "group, users should input either:

  • a numeric scalar ("constant"): the constant probability of observing an edge for all edges

  • a numeric matrix ("matrix"): the probabilities of observing an edge for each edges

  • a character scalar: for common sampling regimes:

    • "random": random edge observation probabilities

  • a user-defined function ("function"): a function of the adjacency matrix Adj (can be named anything) that returns a matrix of the probabilities of observing an edge for each edges

all.sampled

logical scalar, should all nodes be sampled at least once? (TO CHECK: does it work with group-scan sampling?)

Value

an empirical scanList object in which, compared to the theoretical.scanList (added to attrs), unobserved edges are replaced by NAs (regardless of them being 0 or 1).

Returned scanList has new attributes added to attrs:

  • obs.P: matrix of probabilities of observing an edge (whether it is 0 or 1)

  • theoretical.scanList: the original theoretical scanList from which some edges have not been observed

See also