R/revise.rho.R

Defines functions revise.rho

Documented in revise.rho

revise.rho <- function(y,gamma,rnms) {
	y <- factor(unlist(y),levels=rnms)
	there <- !is.na(y)
	t1 <- apply(gamma[,there],1,
		function(x,index){tapply(x,index,sum)},y[there])
	t1[is.na(t1)] <- 0
	Rho <- t(t(t1)/apply(t1,2,sum))
        rownames(Rho) <- rnms
        Rho
}

Try the hmm.discnp package in your browser

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

hmm.discnp documentation built on May 29, 2017, 12:28 p.m.