Learn R Programming

emax.glm (version 0.1.2)

logLik.em.glm: Calculate log-likelihood of the EM model.

Description

Calculate log-likelihood of the EM model.

Usage

# S3 method for em.glm
logLik(object, x, y, weight = c(1), ...)

Arguments

object

A 'em.glm' class returned by the em.glm function.

x

An n-by-p design matrix.

y

A vector of observation of length n.

weight

A n length vector of observation weight terms. This is currently designed to be either the exposure for a Poisson model or the number of trials for a Logistic model.

...

optionally more fitted model objects.

Value

Model log-likelihood.

Examples

Run this code
# NOT RUN {
x <- model.matrix(~ factor(wool) + factor(tension), warpbreaks)
y <- warpbreaks$breaks
m <- em.glm(x = x, y = y, K = 2, b.init = "random")
logLik(m, x, y)

# }

Run the code above in your browser using DataLab