simulateLSM: Simulate from LSM model

Description Usage Arguments Examples

Description

Function to simulate networks from the LSM model

Usage

1
simulateLSM(object, Y = NULL, nsim = 100, seed, directed = NULL)

Arguments

object

object of class 'lsm'

Y

(N x N) binary adjacency matrix

nsim

number of simulations. Default nsim = 100

seed

for simulations

directed

if the network is directed or not. Default directed = NULL

Examples

 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))

lvm4net documentation built on June 13, 2019, 5:03 p.m.