Description Usage Arguments Value Author(s) References See Also Examples
Functions for implementation of Generalized blockmodeling for valued
networks where the values of the ties are assumed to be measured on at least interval
scale. critFunC
calculates criterion function, based on the network, partition and blockmodel/equivalece. optParC
optimizes a partition based on the criterion function based on a local search algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | critFunC(M, clu, approaches, blocks, isTwoMode = NULL, isSym = NULL,
diag = 1, IM = NULL, EM = NULL, Earr = NULL, justChange = FALSE,
rowCluChange = c(0, 0), colCluChange = c(0, 0), sameIM = FALSE,
regFun = "max", homFun = "ss", usePreSpecM = NULL, preSpecM = NULL,
save.initial.param = TRUE, relWeights = 1, posWeights = 1,
blockTypeWeights = 1, combWeights = NULL, returnEnv = FALSE)
optParC(M, nMode = NULL,isSym = NULL, diag = 1, clu, approaches, blocks,
useMulti = FALSE, maxPar = 50, IM = NULL, EM = NULL, Earr = NULL,
justChange = FALSE, sameIM = FALSE, regFun = "max", homFun = "ss",
usePreSpecM = NULL, preSpecM = NULL, minUnitsRowCluster = 1,
minUnitsColCluster = 1, maxUnitsRowCluster = 9999,
maxUnitsColCluster = 9999, relWeights = 1, posWeights = 1,
blockTypeWeights = 1, combWeights = NULL, exchageClusters = "all",
save.initial.param = TRUE)
|
M |
A matrix representing the (usually valued) network. For multi-relational networks, this should be an array with the third dimension representing the relation. The network can have one or more modes (diferent kinds of units with no ties among themselves). If the network is not two-mode, the matrix must be square. |
clu |
A partition. Each unique value represents one cluster. If the nework is one-mode, than this should be a vector, else a list of vectors, one for each mode. |
approaches |
One of the approaches (for each relation in multi-relational netowrks in a vector) described in Žiberna (2006). Possible values are: |
blocks |
A vector, a list of vectors or an array with names of allowed blocy types. |
isTwoMode |
|
isSym |
Specifying if the matrix (for each relation) is symetric. |
diag |
Should the special stauts of diagonal be acknowladged. The default value is set to |
IM |
The obtained image for objects. |
EM |
Block errors by blocks. |
Earr |
The array of errors for all allowed block types by next dimensions: allowed block types, relations, row clusters and column clusters. The dimensions should match the dimensions of the block argument if specified as an array. |
justChange |
Value specifying if only the errors for changed clusters should be computed. Used only for debugging purposes by developers. |
rowCluChange |
An array holding the two row clusters where the change occured. Used only for debugging purposes by developers. |
colCluChange |
An array holding the col row clusters where the change occured. Used only for debugging purposes by developers. |
sameIM |
Should we damand the same blockmodel image for all relations. The default value is set to |
regFun |
Function f used in row-f-regular, column-f-regular, and f-regular blocks. Not used in binary approach. For multi-relational networks, it can be a vector of such character strings. The default value is set to |
homFun |
In case of homogenity blockmodeling two vairability criteria can be used: |
usePreSpecM |
Specifiying weather a pre-specified value should be used when computing inconsistency. |
preSpecM |
Suficient value for individual cells for valued approach. Can be a number or a character string giving the name of a function. Set to |
save.initial.param |
Should the inital parameters ( |
relWeights |
Weights for all type of relations in a blockmodel. The default value is set to |
posWeights |
Weigths for positions in the blockmodel (the dimensions must be the same as the error matrix). For now this is a matix (two-dimensional) even for multi-relational networks. |
blockTypeWeights |
Weights for each type of block used, if they are to be different accros block types (see |
combWeights |
Weights for all type of block used, The default value is set to |
returnEnv |
Should the function also return the environment after its completion. |
useMulti |
Which version of local search should be used. The default value is set to |
maxPar |
The number of partitions with optimal criterion fuction to be returned. Only used If |
nMode |
Number of nodes. If |
minUnitsRowCluster |
Minimum number of units in row cluster. |
minUnitsColCluster |
Minimum number of units in col cluster. |
maxUnitsRowCluster |
Maximum number of units in row cluster. |
maxUnitsColCluster |
Maximum number of units in col cluster. |
exchageClusters |
A matrix of dimensions "number of clusters" x "number of clusters" indicating to which clusters can units from a specific cluster be moved. Useful for multilevel blockmodeling or/in some other cases where some units cannot mix. |
A list:
M |
The matrix of the network analyzed. |
err |
The error or inconsistency emplirical network with the ideal network for a given blockmodel (model,approach,...) and paritition. |
clu |
The analyzed partition. |
EM |
Block errors by blocks. |
IM |
The obtained image for objects. |
BM |
Block means by block - only for Homogeneity blockmodeling. |
Earr |
The array of errors for all allowed block types by next dimensions: allowed block types, relations, row clusters and column clusters. The dimensions should match the dimensions of the block argument if specified as an array. |
Aleš Žiberna
ŽIBERNA, Aleš (2006): Generalized Blockmodeling of Valued Networks. Social Networks, Jan. 2007, vol. 29, no. 1, 105-126. http://dx.doi.org/10.1016/j.socnet.2006.04.002.
ŽIBERNA, Aleš. Direct and indirect approaches to blockmodeling of valued networks in terms of regular equivalence. J. math. sociol., 2008, vol. 32, no. 1, 57-84. http://www.informaworld.com/smpp/content?content=10.1080/00222500701790207.
DOREIAN, Patrick, BATAGELJ, Vladimir, FERLIGOJ, Anuška (2005): Generalized blockmodeling, (Structural analysis in the social sciences, 25). Cambridge [etc.]: Cambridge University Press, 2005. XV, 384 p., ISBN 0-521-84085-6.
optRandomParC
, IM
, clu
, err
, plot.crit.fun
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ## Generating a simple network corresponding to the simple Sum of squares
## Structural equivalence with blockmodel:
## nul com
## nul nul
n <- 20
net <- matrix(NA, ncol = n, nrow = n)
clu <- rep(1:2, times = c(5, 15))
tclu <- table(clu)
net[clu == 1, clu == 1] <- rnorm(n = tclu[1] * tclu[1], mean = 0, sd = 1)
net[clu == 1, clu == 2] <- rnorm(n = tclu[1] * tclu[2], mean = 4, sd = 1)
net[clu == 2, clu == 1] <- rnorm(n = tclu[2] * tclu[1], mean = 0, sd = 1)
net[clu == 2, clu == 2] <- rnorm(n = tclu[2] * tclu[2], mean = 0, sd = 1)
## Computation of criterion function with the correct partition
res <- critFunC(M = net, clu = clu, approaches = "hom", homFun = "ss", blocks = "com")
res$err ## the error is relativly small
res$BM ## The block means are around 0 or 4
plot(res)
## Computation of criterion function with the correct partition and correct pre-specified blockmodel
## Prespecified blockmodel used
## nul com
## nul nul
B <- array(NA, dim = c(1, 1, 2, 2))
B[1, 1, , ] <- "nul"
B[1, 1, 1, 2] <- "com"
B[1, 1, , ]
res <- critFunC(M = net, clu = clu, approaches = "hom", homFun = "ss", blocks = B)
res$err ## the error is relativly small
res$IM
plot(res)
## Computation of criterion function with the correct partition
# and pre-specified blockmodel with some alternatives
## Prespecified blockmodel used
## nul nul|com
## nul nul
B <- array(NA, dim = c(2, 2, 2))
B[1, , ] <- "nul"
B[2, 1, 2] <- "com"
res <- critFunC(M = net, clu = clu, approaches = "hom", homFun = "ss", blocks = B)
res$err ## the error is relativly small
res$IM
plot(res)
## Computation of criterion function with random partition
clu.rnd <- sample(1:2, size = n, replace = TRUE)
res.rnd <- critFunC(M = net, clu = clu.rnd, approaches = "hom",
homFun = "ss", blocks = "com")
res.rnd$err ## the error is larger
res.rnd$BM ## random block means
plot(res.rnd)
#adapt network for Valued blockmodeling with the same model
net[net > 4] <- 4
net[net < 0] <- 0
## Computation of criterion function with the correct partition
res <- critFunC(M = net, clu = clu, approaches = "val",
blocks = c("nul", "com"), preSpecM = 4)
res$err ## the error is relativly small
res$IM
## The image corresponds to the one used for generation of
## The network
plot(res)
## Computation of criterion function with random partition
res.rnd <- critFunC(M = net, clu = clu.rnd, approaches = "val",
blocks = c("nul", "com"), preSpecM = 4)
res.rnd$err ## the error is larger
res.rnd$IM ## all blocks are probably nul
plot(res.rnd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.