logLik.gremlin function

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

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

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

## S3 method for class 'gremlin' logLik(object, ...) npar.gremlin(object) ## S3 method for class '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.

Returns

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

Details

Function npar.gremlin returns an object with attributes n.fxd

and n.bndry which give additional information about the parameters estimated and contributing to the overall df of the model. n.fxd

returns the total number of parameters (No. fixed effects + No. (co)variance components) minus the number of parameters constrained to a certain value. Thus, n.fxd represents the number of parameters that can vary and, as a consequence, affect the log-likelihood.

The attribute n.bndry reports the number of parameters that were restrained to stay inside the boundaries of allowable parameter space (e.g., a variance that was not allowed to be negative).

Examples

grS <- gremlin(WWG11 ~ sex - 1, random = ~ sire, data = Mrode11) logLik(grS) AIC(grS)

Author(s)

matthewwolak@gmail.com

  • Maintainer: Matthew Wolak
  • License: GPL-3 | file LICENSE
  • Last published: 2024-11-04