R/AICc.R

Defines functions AICc

Documented in AICc

## corrected AIC calculation
AICc <- function(object, k=2){
  ll <- logLik(object)
  d <- attributes(ll)$df
  n <- attributes(ll)$nobs
  ic <- -2*ll+ k*d*n/(n-d-1)
  ic[d+1 > n] <- Inf
  attributes(ic)[c('df','nobs','class')] <- NULL
  ic
}
TaddyLab/gamlr documentation built on April 17, 2023, 7:23 p.m.