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
}

Try the gamlr package in your browser

Any scripts or data that you put into this service are public.

gamlr documentation built on April 17, 2023, 1:06 a.m.