File: ctmcdlogLik.R

package info (click to toggle)
r-cran-ctmcd 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,384 kB
  • sloc: cpp: 183; ansic: 19; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 279 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)
}