\HeaderA{logLik.lme}{Log-Likelihood of an lme Object}{logLik.lme}
\aliasA{logLik.gls}{logLik.lme}{logLik.gls}
\keyword{models}{logLik.lme}
\begin{Description}\relax
If \code{REML=FALSE}, returns the log-likelihood value of the linear
mixed-effects model represented by \code{object} evaluated at the
estimated  coefficients; else, the restricted log-likelihood evaluated
at the estimated coefficients is returned.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'lme':
logLik(object, REML, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{lme}, representing
a fitted linear mixed-effects model.
\item[\code{REML}] an optional logical value.  If \code{TRUE} the restricted
log-likelihood is returned, else, if \code{FALSE}, the log-likelihood
is returned. Defaults to the method of esitmation used, that is
\code{TRUE} if and only \code{object} was fitted with \code{method =
     "REML"} (the default for these fitting functions) . 
\item[\code{...}] some methods for this generic require additional
arguments.  None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
the (restricted) log-likelihood of the model represented by
\code{object} evaluated at the estimated coefficients.
\end{Value}
\begin{Author}\relax
Jose Pinheiro and Douglas Bates
\end{Author}
\begin{References}\relax
Harville, D.A. (1974) ``Bayesian Inference for Variance Components
Using Only Error Contrasts'', \emph{Biometrika}, \bold{61}, 383--385.

Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models
in S and S-PLUS", Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{lme}{lme}},\code{\LinkA{gls}{gls}},
\code{\LinkA{logLik.corStruct}{logLik.corStruct}},
\code{\LinkA{logLik.glsStruct}{logLik.glsStruct}},
\code{\LinkA{logLik.lmeStruct}{logLik.lmeStruct}},
\code{\LinkA{logLik.lmList}{logLik.lmList}},
\code{\LinkA{logLik.reStruct}{logLik.reStruct}},
\code{\LinkA{logLik.varFunc}{logLik.varFunc}},
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fm1 <- lme(distance ~ Sex * age, Orthodont, random = ~ age, method = "ML")
logLik(fm1)
logLik(fm1, REML = TRUE)
\end{ExampleCode}
\end{Examples}

