View source: R/nemSymBMinout.R
| nemSymBMinout | R Documentation | 
Generate a symmetric network with a selected blockmodel type and partition with a specified number of incomers and outgoers. Considers local network mechanisms when creating links within blocks.
nemSymBMinout( X = X, partition = partition, M = M, formula = NULL, theta = NULL, nin = 5, nout = 20, minClusterSize = 5, k = 1000, loops = FALSE, randomizeP = 0, randomSD = 0.02 )
X | 
 Initial binary network; of class   | 
partition | 
 A desired partition in a vector format. Each unique value (positive integers) represents one cluster.  | 
M | 
 Desired image matrix with block densities.  | 
formula | 
 The list of local netork mechanisms to be considered.  | 
theta | 
 A vector with the mechanisms' weights/strengths.  | 
nin | 
 Number of incomers.  | 
nout | 
 Number of outgoers.  | 
minClusterSize | 
 Minimum cluster size.  | 
k | 
 Number of iterations.  | 
loops | 
 Wheter loops are allowed or not (default   | 
randomizeP | 
 The share of units to be randomly relocated between clusters.  | 
randomSD | 
 The srandard deviation of a normal distribution form which the random part of weighed network statistics is sampled.  | 
The list with the following elements:
initialNetwork - Initial network; of class matrix.
finalNetwork - Final (generated) network; of class matrix.
initialPartition - Initial partition.
finalPartition - Final partition (i.e., partition after randomization and after incomers and outgoers).
M - The desired (specified) image matrix.
k - The number of iterations.
combinedPartitions - Data frame with initial and final partition.
whenIncomers - A vector of which elements tells us at which iterations the incomers were added.
whenOutgoers - A vector of which elements tells us at which iterations the outgoers were removed.
ERR - Sum of squared differences between the desired and empirical densities across blocks; for each iteration.
linkERR - The difference in the number of links between the generated number of links and desired number of links; for each iteration.
Marjan Cugmas and Aleš Žiberna
formula <- list(mutuality, popularity, OTPtransitivity)
X <- matrix(sample(c(0,1), size = 9**2, replace = TRUE), nrow = 9)
diag(X) <- 0
M <- matrix(c(0.1, 0.8, 0.8, 0.1), nrow = 2)
partition <- c(1, 2, 2, 1, 1, 2, 2, 2, 1)
nemSymBMinout(X = X, 
              partition = partition, 
              formula = formula, 
              theta = c(1, 1, 1), 
              M = M, 
              k = 100, 
              minClusterSize = 2,
              nin = 10,
              nout = 5,
              loops = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.