crit.fun {blockmodeling} | R Documentation |
The function computes the value of a criterion function for a given network and partition for Generalized blockmodeling. (Žiberna, 2006) based on other parameters (see below).
crit.fun(M, clu, approach, ...)
M |
A matrix representing the (usually valued) network. For now, only one-relational networks are supported. The network can have one or more modes (diferent kinds of units with no ties among themselvs. 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 |
approach |
One of the approaches described in Žiberna (2006). Possible values are: "bin" - binary blockmodeling, "val" - valued blockmodeling, "imp" - implicit blockmodeling, "ss" - sum of squares homogenity blockmodeling, and "ad" - absolute deviations homogenity blockmodeling. |
... |
Several arguments, which are explaind below. They are actually used by the function gen.crit.fun , however since this functions is not intented to be called directly, it also has no help files. Therefore these arguments are described below. Which are needed depends on the approach selected |
blocks |
A vector with names of allowed blocktypes. For approaches "bin", "imp" and "val", at leasat two should be selected. Possible values are are: "null" - null or empty block "com" - complete block "rdo", "cdo" - row and column-dominant blocks (binary, valued, and implicit approach only) "reg" - (f-)regular block "rre", "cre" - row and column-(f-)regular blocks "rfn", "cfn" - row and column-dominant blocks (binary, valued, and implicit approach only) "den" - density block (binary approach only) "avg" - average block (valued and implicit approach only) "dnc" - do not care block - the error is always zero The ordering is important, since if several block types have identical error, the first on the list is selected. |
BLOCKS |
An alternative to blocks . A pre-specified blockmodel. An array with dimensions three dimensions (see example below). The second and the third repreent the clusters (for rows and columns), while the first is as long as the maxsimum number of allows block types for a given block. If some block has less possible block types, the empty slots should have values NA . The values in the array should be the ones from above. |
m |
Suficient value for individual cells for valued approach. Can be a number or a character string giving the name of a function. Set to "max" for implicit approach. |
cut |
(default = min(M[M > 0]) ) The threshold used for binerizing the network for use with binary blockmodeling. All values with values lower than cut are recoded into 0s, all other into 1s. |
FUN |
(default = "max") Function f used in row-f-regular, column-f-regular, and f-regular blocks. Not used in binary approach. |
norm |
Should the block errors (inconsistencies) be normalized with the size of the blocks, the block error does not depend on block size? The default is FALSE . Original version of implicit approach suggests TRUE , however the default is FALSE even for this approach based on better results in simulations. |
normbym |
The default is FALSE for valued and implicit approach, elsewher not used. Original version of implicit approach suggests TRUE , however the default is FALSE even for this approach based on better results in simulations. |
max.con.val |
|
mindim |
(default = 2) Minimal dimension (number of rows or columns) demanded for row and column-dominant and -functional blocks. |
mindimreg |
(default = FALSE ) Should the mindim argument also be used for (row or coulum-)(f-)regular blocks |
block.weights |
Weights for each type of block used, if they are to be different accros block types (see blocks above). It must be suplied in form of a named vetor block.weights = c(name.of.block.type1=weight,...) . If some of the block types used are not listed, they are given weight 1. |
save.err.v |
(default = FALSE ) Should the error vector for all allowed block types in each block be saved? |
BLOCK.CV |
A matrix of central values by blocks for pre-specified homogenity (sum of squares and absolute deviations) approach. |
use.for |
(default = TRUE ) Should FORTRAN subrutines be used where available (available for only very special cases) |
diag |
(default = TRUE ) Should the special stauts of diagonal be acknowladged. |
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 |
E |
Block errors by blocks |
IM |
The obtained image |
BM |
Block means by block - only for Homogeneity blockmodeling |
ERR.V |
If selected. The error vector of errors for all allowed block types by blocks |
Aleš Žiberna
ŽIBERNA, Aleš. Generalized blockmodeling for valued networks. V: SUNBELT XXV : Program and abstracts. Redondo Beach, 2005, p. 79. http://www.socsci.uci.edu/~ssnconf/conf/SunbeltXXVProgram.pdf.
DOREIAN, Patrick, BATAGELJ, Vladimir, FERLIGOJ, Anuška. Generalized blockmodeling, (Structural analysis in the social sciences, 25). Cambridge [etc.]: Cambridge University Press, 2005. XV, 384 p., ISBN 0-521-84085-6.
opt.par
,opt.random.par
,opt.these.par
,check.these.par
,plot.crit.fun
#generating a simple network corresponding to the simple Sum of squares structural equivalence with blockmodel: # null com # null null 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<-crit.fun(M=net,clu=clu,approach="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 random partition clu.rnd<-sample(1:2,size=n,replace=TRUE) res.rnd<-crit.fun(M=net,clu=clu.rnd,approach="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<-crit.fun(M=net,clu=clu,approach="val",blocks=c("null","com"),m=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<-crit.fun(M=net,clu=clu.rnd,approach="val",blocks=c("null","com"),m=4) res.rnd$err #the error is larger res.rnd$IM #all blocks are probably null plot(res.rnd)