logLik.gls {nlme}R Documentation

Log-Likelihood of a gls Object

Description

If REML=FALSE, returns the log-likelihood value of the linear model represented by object evaluated at the estimated coefficients; else, the restricted log-likelihood evaluated at the estimated coefficients is returned.

Usage

logLik(object, REML, ...)

Arguments

object an object inheriting from class gls, representing a generalized least squares fitted linear model.
REML an optional logical value. If TRUE the restricted log-likelihood is returned, else, if FALSE, the log-likelihood is returned. Defaults to FALSE.
... some methods for this generic require additional arguments. None are used in this method.

Value

the (restricted) log-likelihood of the linear model represented by object evaluated at the estimated coefficients.

Author(s)

Jose Pinheiro Jose.Pinheiro@pharma.novartis.com and Douglas Bates bates@stat.wisc.edu

References

Harville, D.A. (1974) "Bayesian Inference for Variance Components Using Only Error Contrasts", Biometrika, 61, 383-385.

See Also

gls

Examples

data(Ovary)
fm1 <- gls(follicles ~ sin(2*pi*Time) + cos(2*pi*Time), Ovary,
           correlation = corAR1(form = ~ 1 | Mare))
logLik(fm1)
logLik(fm1, REML = FALSE)

[Package Contents]