Learn R Programming

gremlin (version 0.1.0.1)

logLik.gremlin: Methods to extract log-likelihood and information criterion of a gremlin model.

Description

Extracts the log-likelihood or AIC from a gremlin model fit.

Usage

# S3 method for gremlin
logLik(object, ...)

# S3 method for gremlin AIC(object, ..., k = 2, fxdDf = FALSE)

Arguments

object

An object of class ‘gremlin’.

Additional arguments.

k

A numeric value for the penalty per parameter. Default is 2, as in classic AIC.

fxdDf

A logical indicating whether to penalize according to the number of fixed effect parameters. Since only models fit by REML can be compared, these must always be the same and so become a constant. Hence, the default is FALSE.

Value

A numeric value for either the log-likelihood and the number of parameters estimated by the model (sum of fixed effects and random effect (co)variance components) or Akaike's Information Criterion.

Examples

Run this code
# NOT RUN {
mod11 <- gremlinR(WWG11 ~ sex - 1,
random = ~ calf,
data = Mrode11,
Gstart = matrix(0.1), Rstart = matrix(0.4),
maxit = 50, v = 2, algit = "EM")
logLik(mod11)
AIC(mod11)
# }

Run the code above in your browser using DataLab