Skip to content
Prev 2415 / 7420 Next

Calculating an AIC for the Fisher's log series.....

Cory,

There is a profile method for fisherfit. If that's not enough, you can
have a look inside of fisherfit, and you'll see the Dev.logseries
internal function and how it is used in nlm to get estimate of alpha.
The same function can be used for manual profiling to get likelihood
values for a sequence of alphas. Note that Dev.logseries returns minus
log-likelihood. You get AIC as -2*logLik+2*p, or just define a logLik
method for fisherfit as

logLik.fisherfit <- function(object, ...) {
    ll <- -object$minimum
    attr(ll, "df") <- length(object$estimate)
    attr(ll, "nobs") <- length(object$fisher)
    class(ll) <- "logLik"
    ll
}

This way, AIC, BIC, etc will work naturally:

data(BCI)
mod <- fisherfit(BCI[5,])
logLik(mod)
AIC(mod)
BIC(mod)

Cheers,

Peter

P?ter S?lymos
Alberta Biodiversity Monitoring Institute
and Boreal Avian Modelling project
Department of Biological Sciences
CW 405, Biological Sciences Bldg
University of Alberta
Edmonton, Alberta, T6G 2E9, Canada
Phone: 780.492.8534
Fax: 780.492.7635
email <- paste("solymos", "ualberta.ca", sep = "@")
http://www.abmi.ca
http://www.borealbirds.ca
http://sites.google.com/site/psolymos
On Wed, Oct 5, 2011 at 11:42 AM, Cory Redman <corymredman at gmail.com> wrote: