R/poLCA.entropy.R

Defines functions poLCA.entropy

Documented in poLCA.entropy

poLCA.entropy <-
function(lc) {
    K.j <- sapply(lc$probs,ncol)
    fullcell <- expand.grid(lapply(K.j,seq,from=1))
    P.c <- poLCA.predcell(lc,fullcell)
    return(-sum(P.c * log(P.c),na.rm=TRUE))
}

Try the poLCA package in your browser

Any scripts or data that you put into this service are public.

poLCA documentation built on April 25, 2022, 5:06 p.m.