Description Usage Arguments Value References Examples
Random partial correlations are generated to weigh the network connections. If multiple networks are provided, the networks must contain the same nodes and the same modules (the connections within modules may differ). Any connection that is common across different networks will also have the same partial correlation weight across networks.
1 2 3 4 5 | gen_partial_correlations(
...,
k = 2.5,
rweights = function(n) (-1)^rbinom(n, 1, 0.5) * runif(n, 0.5, 1)
)
|
... |
The 'network' objects to modify. |
k |
An positive number used to ensure that the matrix inverse is
numerically stable. |
rweights |
A generator for initial weights in the network. By default, values are generated uniformly from (-1, -0.5) U (0.5, 1). The weights will be adjusted so that the sign of a generated weight and the sign of the corresponding partial correlation agree. |
An updated network object containing random weights. If multiple networks were provided, then a list of network objects is returned.
grimes21SeqNet
1 2 | nw <- random_network(10) # Create a random network with 10 nodes.
nw <- gen_partial_correlations(nw) # Add weights to connections in the network.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.