R/revise.tpm.R

Defines functions revise.tpm

Documented in revise.tpm

revise.tpm <- function(xi,mixture) {
    if(mixture)  {
        matrix(apply(xi,2,sum)/sum(xi),byrow=TRUE,
               nrow=nrow(xi),ncol=ncol(xi))
    } else {
        den <- apply(xi,1,sum)
        if(any(den == 0))
            stop("At least one row of new tpm would be all zeroes.\n")
        xi/den
    }
}

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 Sept. 26, 2022, 5:05 p.m.