simulate_lbm | R Documentation |
Simulate a bipartite interaction network using block model
simulate_lbm(con, pi, rho, nr, nc, method = "gnp")
con |
A matrix, the connectivity between blocks. If
|
pi |
A vector of the same length as |
rho |
A vector of the same length as |
nr |
The number of row Species |
nc |
The number of column Species |
method |
One of |
A list of 3 elements:
A
The incident matrix of size nr
xnc
Z
A vector of length nr
, the block assignment of the row
species
W
A vector of length nc
, the block assignment of the column
species
# For a random number of interactions and blocks sizes
con <- matrix(c(.5,.3,.3,.1), 2, 2)
pi <- c(.25,.75)
rho <- c(1/3, 2/3)
nr <- 50
nc <- 30
simulate_lbm(con, pi, rho, nr, nc, method = "gnp")
# For a fixed number of ineractions and blocks sizes
con <- matrix(c(50, 120, 60, 80), 2, 2)
pi <- c(10, 40)
rho <- c(10, 20)
nr <- 50
nc <- 30
simulate_lbm(con, pi, rho, nr, nc, method = "gnm")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.