| update_module_with_random_weights {SeqNet} | R Documentation |
The small-world network is generated using the Watts-Strogatz method.
See watts.strogatz.game for details.
update_module_with_random_weights(
module,
rdist = function(n) { runif(n, 0.5, 1) * (-1)^rbinom(n, 1, 0.5) },
...
)
module |
The network_module object to modify. |
rdist |
A distribution function that generates random numbers. The first argument should specify the number of weights to generate. By default, weights are generated uniformly from the set (-1, -0.5)U(0.5, 1). |
... |
Additional parameters are ignored. |
An updated 'network_module' object.
# Create a random module. module <- random_module(1:10) is_weighted(module) # Add a random weight to each connection. module <- update_module_with_random_weights(module) is_weighted(module)