ICLStochBlock function

Function that computes integrated classification likelihood based on stochastic one-mode and linked block modeling. If clu is a list, the method for linked/multilevel networks is applied. The support for multirelational networks is not tested.

Function that computes integrated classification likelihood based on stochastic one-mode and linked block modeling. If clu is a list, the method for linked/multilevel networks is applied. The support for multirelational networks is not tested.

ICLStochBlock( M, clu, weights = NULL, uWeights = NULL, diagonal = c("ignore", "seperate", "same"), limitType = c("none", "inside", "outside"), limits = NULL, weightClusterSize = 1, addOne = TRUE, eps = 0.001 )

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.

  • 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. Similarly, if units are comprised of several sets, clu should be the list containing one vector for each set.

  • weights: The weights for each cell in the matrix/array. A matrix or an array with the same dimmensions as M.

  • uWeights: The weights for each unin. A vector with the length equal to the number of units (in all sets).

  • diagonal: How should the diagonal values be treated. Possible values are:

    • ignore - diagonal values are ignored
    • seperate - diagonal values are treated seperately
    • same - diagonal values are treated the same as all other values
  • limitType: Type of limit to use. Forced to 'none' if limits is NULL. Otherwise, one of either outer or inner.

  • limits: If diagonal is "ignore" or "same", an array with dimensions equal to:

    • number of clusters (of all types)
    • number of clusters (of all types)
    • number of relations
    • 2 - the first is lower limit and the second is upper limit

    If diagonal is "seperate", a list of two array. The first should be as described above, representing limits for off diagonal values. The second should be similar with only 3 dimensions, as one of the first two must be omitted.

  • weightClusterSize: The weight given to cluster sizes (logprobabilites) compared to ties in loglikelihood. Defaults to 1, which is "classical" stochastic blockmodeling.

  • addOne: Should one tie with the value of the tie equal to the density of the superBlock be added to each block to prevent block means equal to 0 or 1 and also "shrink" the block means toward the superBlock mean. Defaults to TRUE.

  • eps: If addOne = FALSE, the minimal deviation from 0 or 1 that the block mean/density can take.

Returns

The value of ICL

Examples

# Create a synthetic network matrix set.seed(2022) library(blockmodeling) k<-2 # number of blocks to generate blockSizes<-rep(20,k) IM<-matrix(c(0.8,.4,0.2,0.8), nrow=2) clu<-rep(1:k, times=blockSizes) n<-length(clu) M<-matrix(rbinom(n*n,1,IM[clu,clu]),ncol=n, nrow=n) clu<-sample(1:2,nrow(M),replace=TRUE) plotMat(M,clu) # Have a look at this random partition ICL_pre<-ICLStochBlock(M,clu) # Calculate its ICL ICL_pre res<-stochBlock(M,clu=clu) # Optimizing the partition plot(res) # Have a look at the optimized partition ICL_post<-res$ICL # Calculate its ICL ICL_post # We expect the ICL pre-optimisation to be smaller: ICL_pre<ICL_post

See Also

llStochBlock; weightsMlLoglik

  • Maintainer: Aleš Žiberna
  • License: GPL (>= 2)
  • Last published: 2023-01-24

Useful links