Calculate log-likelihood for transition data

log_likelihood(params, data)

Arguments

params

numeric vector of length 4 (nodk) or 8 (dk)

data

numeric vector of transition counts

Value

scalar log-likelihood

Examples

params <- c(0.4, 0.3, 0.3, 0.25)
data <- c(x00 = 10, x01 = 5, x10 = 3, x11 = 12)
log_likelihood(params, data)
#> [1] -39.7027