system.simulate | R Documentation |
Simulate Inverse Community Matrices for a Network
system.simulate( n.sims, edges, required.groups = c(0), sampler = community.sampler(edges, required.groups), validators = NULL )
n.sims |
number of matrices to simulate. |
edges |
an edge list. |
required.groups |
a vector of integers specifying which groups of edges must always occur in the community matrix. |
sampler |
the sampler object used to generate random weights (see
|
validators |
an (optional) list of validation functions generated by
|
Generate sets of edge weights and the inverse community matrices given a directed graph and validation criteria by rejection sampling. Matrices with a pattern of signs consistent with the given model are generated, and only the matrices that correspond to stable equilibria and consistent with the given validation criteria are retained. For matrices retained in the sample, the matrix is inverted, and the inverse community matrix, and the weights that define the community matrix are returned. The function also returns the total number of matrices generated, the number of these that are stable and the number that are ultimately accepted for the sample.
The output of this function may be passed to the interactive exploratory tools.
This function is a simple wrapper for community.sampler
,
stable.community
and the functions generated by
press.validate
.
Returns a list with elements
|
The edge list |
|
A list of inverse community matrices |
|
A matrix of the corresponding edge weights |
|
The total number of matrices generated |
|
The number of stable matrices generated |
|
The number of matrices accepted for the sample |
set.seed(32) ## Sample model edges <- parse.digraph(c( "E *-> D", "D *-> C", "C -> E", "E *-> B", "B *-> A", "A -> E", "D --> B")) edges <- enforce.limitation(edges) sims <- system.simulate(10,edges, validators=list( press.validate(edges, perturb=c(D=1), monitor=c(D=1)), press.validate(edges, perturb=c(D=1), monitor=c(B=-1,C=1))))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.