\HeaderA{BIC.logLik}{BIC of a logLik Object}{BIC.logLik}
\keyword{models}{BIC.logLik}
\begin{Description}\relax
This function calculates the Bayesian information criterion,
also known as Schwarz's Bayesian criterion (SBC) for an object
inheriting from class \code{logLik}, according to the formula 
\eqn{-2 \mbox{log-likelihood} + n_{par} \log(n_{obs})}{log-likelihood +
npar*log(nobs)}, where \eqn{n_{par}}{npar} represents the number of
parameters  and \eqn{n_{obs}}{nobs} the number of  observations in the
fitted model. When comparing fitted objects, the smaller the BIC, the
better the fit.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'logLik':
BIC(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object inheriting from class \code{logLik}, usually
resulting from applying a \code{logLik} method to a fitted model
object.
\item[\code{...}] some methods for this generic use optional arguments.
None are used in this method.
\end{ldescription}
\end{Arguments}
\begin{Value}
a numeric value with the corresponding BIC.
\end{Value}
\begin{Author}\relax
Jose Pinheiro \email{Jose.Pinheiro@pharma.novartis.com} and Douglas Bates \email{bates@stat.wisc.edu}
\end{Author}
\begin{References}\relax
Schwarz, G. (1978) "Estimating the Dimension of a Model", Annals of
Statistics, 6, 461-464.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{BIC}{BIC}}, \code{\LinkA{logLik}{logLik}}, \code{\LinkA{AIC}{AIC}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fm1 <- lm(distance ~ age, data = Orthodont) 
BIC(logLik(fm1))
\end{ExampleCode}
\end{Examples}

