Description Usage Arguments Examples
Function to simulate networks from the LSM model
1 | simulateLSM(object, Y = NULL, nsim = 100, seed, directed = NULL)
|
object |
object of class |
Y |
( |
nsim |
number of simulations. Default |
seed |
for simulations |
directed |
if the network is directed or not. Default |
1 2 3 4 5 6 7 8 9 10 11 12 13 | n <- 20
Y <- network(n, directed = FALSE)[,]
modLSM <- lsm(Y, D = 2)
Ysim <- simulateLSM(modLSM, Y = Y, nsim = 8)
# store EZ, to keep the nodes in the same positions
# and compare the networks
EZ <- modLSM$lsmEZ
par(mfrow = c(3,3))
plotY(Y, EZ = EZ, main = "Original Data")
for(i in 1:8) plotY(Ysim[[i]], EZ = EZ, main = paste("Simulation" , i))
par(mfrow = c(1,1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.