stochBlockKMint {StochBlock} | R Documentation |
A function for using k-means to initialized the stochastic one-mode and linked blockmodeling.
Description
A function for using k-means to initialized the stochastic one-mode and linked blockmodeling.
Usage
stochBlockKMint(
M,
k,
nstart = 100,
perm = 0,
sharePerm = 0.2,
save.initial.param = TRUE,
deleteMs = TRUE,
max.iden = 10,
return.all = FALSE,
return.err = TRUE,
seed = NULL,
maxTriesToFindNewPar = perm * 10,
skip.par = NULL,
printRep = ifelse(perm <= 10, 1, round(perm/10)),
n = NULL,
nCores = 1,
useParLapply = FALSE,
cl = NULL,
stopcl = is.null(cl),
...
)
Arguments
M |
A square matrix giving the adjaciency relationg between the network's nodes (aka vertexes) |
k |
The number of clusters used in the generation of partitions. |
nstart |
number of random starting points for the classical k-means algorithm (for each set of units). Defaults to |
perm |
Number or partitions obtained by randomly permuting the k-means partition - if 0, no permutations are made, only the original partition is analyzed. |
sharePerm |
The probability that a unit will have their randomly assigned. Defaults to |
save.initial.param |
Should the inital parameters( |
deleteMs |
Delete networks/matrices from the results of to save space. Defaults to |
max.iden |
Maximum number of results that should be saved (in case there are more than |
return.all |
If |
return.err |
Should the error for each optimized partition be returned. Defaults to |
seed |
Optional. The seed for random generation of partitions. |
maxTriesToFindNewPar |
The maximum number of partition try when trying to find a new partition to optimize that was not yet checked before - the default value is |
skip.par |
The partitions that are not allowed or were already checked and should therefore be skipped. |
printRep |
Should some information about each optimization be printed. |
n |
The number of units by "modes". It is used only for generating random partitions. It has to be set only if there are more than two modes or if there are two modes, but the matrix representing the network is one mode (both modes are in rows and columns). |
nCores |
Number of cores to be used. Value |
useParLapply |
Should |
cl |
The cluster to use (if formed beforehand). Defaults to |
stopcl |
Should the cluster be stopped after the function finishes. Defaults to |
... |
Arguments passed to other functions, see |
Value
A list containing:
M |
The one- or multi-mode matrix of the network analyzed |
res |
If |
best |
A list of results from |
err |
If |
nIter |
The vector of the iterations on each starting partition. If many of the values equal |
checked.par |
If selected - A list of checked partitions. If |
call |
The call to this function. |
initial.param |
If selected - The initial parameters are used. |
Author(s)
Aleš, Žiberna
References
Škulj, D., & Žiberna, A. (2022). Stochastic blockmodeling of linked networks. Social Networks, 70, 240-252.