Learn R Programming

blockmodeling (version 0.1.7)

crit.fun: Computes the criterion function for a given network and partition

Description

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

Usage

crit.fun(M, clu, approach, ...)

Arguments

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 themselvs. If
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 (for each relation in multi-relational netowrks in a vector) described in Žiberna (2006). Possible values are: "bin" - binary blockmodeling, "val" - valued blockmodeling, "imp" - implicit blockmodeling, "ss" - sum of squares homogeni
...
Several other arguments, which are explaind below. They are actually used by the function gen.crit.fun, however since this function is not intented to be called directly, it also has no help files. Therefore these arguments are described belo

Value

  • A list:
  • MThe matrix of the network analyzed
  • errThe error or inconsistency emplirical network with the ideal network for a given blockmodel (model,approach,...) and paritition
  • cluThe analyzed partition
  • EBlock errors by blocks
  • IMThe obtained image
  • BMBlock means by block - only for Homogeneity blockmodeling
  • ERR.VIf selected. The error vector of errors for all allowed block types by blocks. The dimmensions are [rows, columns (,relations - if more than 1)]. Each cell contains a list of errors by block types

References

ŽIBERNA, Aleš{ZIBERNA, Ales} (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š{ZIBERNA, Ales}. 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{Anuska} (2005): Generalized blockmodeling, (Structural analysis in the social sciences, 25). Cambridge [etc.]: Cambridge University Press, 2005. XV, 384 p., ISBN 0-521-84085-6.

See Also

opt.par, opt.random.par, opt.these.par, check.these.par, plot.crit.fun

Examples

Run this code
#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)

Run the code above in your browser using DataLab