critFunCMC {nem} | R Documentation |
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.
critFunCMC(res, compIM)
res |
an object returned by a function |
compIM |
an ideal blockmodel with possible blocks of type |
It return a single value.
Marjan Cugmas
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))) }