simulate_lbm {robber} | R Documentation |
Simulate a bipartite interaction network using block model
Description
Simulate a bipartite interaction network using block model
Usage
simulate_lbm(con, pi, rho, nr, nc, method = "gnp")
Arguments
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 |
Value
A list of 3 elements:
-
A
The incident matrix of sizenr
xnc
-
Z
A vector of lengthnr
, the block assignment of the row species -
W
A vector of lengthnc
, the block assignment of the column species
Examples
# 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")