\HeaderA{BIC}{Bayesian Information Criterion}{BIC}
\methaliasA{BIC.gls}{BIC}{BIC.gls}
\methaliasA{BIC.lm}{BIC}{BIC.lm}
\methaliasA{BIC.lme}{BIC}{BIC.lme}
\methaliasA{BIC.lmList}{BIC}{BIC.lmList}
\methaliasA{BIC.nlme}{BIC}{BIC.nlme}
\methaliasA{BIC.nls}{BIC}{BIC.nls}
\methaliasA{BIC.nlsList}{BIC}{BIC.nlsList}
\keyword{models}{BIC}
\begin{Description}\relax
This generic function calculates the Bayesian information criterion,
also known as Schwarz's Bayesian criterion (SBC), for one or several
fitted model objects for which a log-likelihood value can be obtained,
according to the formula \eqn{-2 \mbox{log-likelihood} + n_{par}
\log(n_{obs})}{-2*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.
\end{Description}
\begin{Usage}
\begin{verbatim}
BIC(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] a fitted model object, for which there exists a
\code{logLik} method to extract the corresponding log-likelihood, or
an object inheriting from class \code{logLik}.
\item[\code{...}] optional fitted model objects.
\end{ldescription}
\end{Arguments}
\begin{Value}
if just one object is provided, returns a numeric value with the
corresponding BIC; if more than one object are provided, returns a
\code{data.frame} with rows corresponding to the objects and columns
representing the number of parameters in the model (\code{df}) and the
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{logLik}{logLik}}, \code{\LinkA{AIC}{AIC}}, \code{\LinkA{BIC.logLik}{BIC.logLik}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
fm1 <- lm(distance ~ age, data = Orthodont) # no random effects
BIC(fm1)
fm2 <- lme(distance ~ age, data = Orthodont) # random is ~age
BIC(fm1, fm2)
\end{ExampleCode}
\end{Examples}

