critFunCMC {nem}R Documentation

Calculate the value of a criterion function

Description

This is a modification of the function critFunCMC from package blockmodeling. It calculate the value of a criterion function by considering the ideal block types.

Usage

critFunCMC(res, compIM)

Arguments

res

an object returned by a function oprRandParC from blockmodeling package

compIM

an ideal blockmodel with possible blocks of type any

Value

It return a single value.

Author(s)

Marjan Cugmas

See Also

minIncBlocks

Examples

critFunCMC <- function(res, compIM){
  ERR <- critFunC(M = res$M,
                  approaches = res$initial.param$dots$approach,
                  clu = clu(res),
                  blocks = res$initial.param$dots$blocks,
                  blockTypeWeights = res$initial.param$dots$blockTypeWeights)

  im.ord <- minIncBlocks(res = res, compIM = compIM)$order
  return(sum(ERR$EM[,im.ord,im.ord] * ifelse(compIM=="any", yes = 0, no = 1)))
}


[Package nem version 0.12.33 Index]