R/ctmcdlogLik.R

ctmcdlogLik <-
function (gm, tmabs, te) 
{
    P = expm(gm * te)
    ll = 0
    for (i in 1:nrow(P)) {
        for (j in 1:ncol(P)) {
            if (P[i, j] > 0) {
                ll = ll + tmabs[i, j] * log(P[i, j])
            }
        }
    }
    return(ll)
}

Try the ctmcd package in your browser

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

ctmcd documentation built on May 31, 2023, 7:55 p.m.