generate_input {diffuStats} | R Documentation |
Function generate_input
generates a random list of
nodes from an igraph object.
It also specifies the true solution generating the
list. The graph object needs to have some attributes
(automatically added through generate_graph
)
generate_input(graph, order, length_inputs, return_matrix = TRUE, seed = NULL)
graph |
an igraph object, typically from
|
order |
numeric or vector, order of the neighbourhoods that generate the list |
length_inputs |
numeric, number of nodes in the generated inputs |
return_matrix |
logical, should inputs be returned as a matrix? |
seed |
numeric, seed for random number generator |
A list whose elements are lists with three slots:
pos
for the true signal generators, neg
for the
nodes that did not generate signal and input
for the
signal itself
g <- generate_graph( fun_gen = igraph::barabasi.game, param_gen = list(n = 200, m = 3, directed = FALSE), seed = 1) synth_input <- generate_input( g, order = 2, length_inputs = 3, return_matrix = TRUE) str(synth_input)