[R]: BIC for gls models
Douglas Bates
bates at stat.wisc.edu
Fri Nov 21 13:38:34 CET 2003
"Eve Corda" <eve.corda at oncfs.gouv.fr> writes:
> I would like to know how the BIC criterion is calculated for models estimated using gls( ) function. I read in Pinheiro & Bates (2000) p84 that
> BIC = -2logL + npar*log(N) (for the ML method), or
> BIC = -2logLR + npar*log(N-p) (for the REML method)
> but when I use any of these formulae I don't obtain the result given by R.
> library(nlme)
Loading required package: lattice
> getS3method("BIC", "gls")
function (object, ...)
{
if ((rt <- nargs()) > 1) {
object <- list(object, ...)
val <- lapply(object, logLik)
val <- as.data.frame(t(sapply(val, function(el) c(attr(el,
"df"), BIC(el)))))
names(val) <- c("df", "BIC")
row.names(val) <- as.character(match.call()[-1])
val
}
else {
BIC(logLik(object))
}
}
<environment: namespace:nlme>
More information about the R-help
mailing list