Description Usage Arguments Value Examples
View source: R/relative_association_functions.R
Used for testing properties of algorithms. Will create an association network that is constructed where some nodes are more "sticky" than others. Or they are in general more associated than others.
1 2 3 4 5 6 7 |
n_variables |
How many variables will be simulated |
n_clusters |
Controls how many clusters are randomly assigned to nodes |
cluster_coherence |
Scalar that multiplies random association value for
nodes in the same clusters. E.g. A value of |
stickiness_dist |
Function that takes a single input: |
association_dist |
Function of same format as |
List with variables with info about each variable (id,
stickiness scalar, and cluster id) and associations which contains
the simulated associations in the format that works for all the functions
that take association_pairs as an input.
1 2 3 4 5 6 7 8 | # Simulate an association network with flat stickiness profile
simulate_sticky_association_network(
n_variables = 10,
n_clusters = 3,
cluster_coherence = 2,
stickiness_dist = function(n) {runif(n)},
association_dist = function(n) {rbeta(n, shape1 = 1, shape2 = 10)}
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.