[R-sig-eco] Calculating an AIC for the Fisher's log series.....

Peter Solymos solymos at ualberta.ca
Wed Oct 5 22:03:02 CEST 2011


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:
> I am trying to calculate an AIC for my Fisher's log series (fisherfit).  In
> order to do this I need the log likelihood.  Does anyone know how to
> calculate the log likelihood for a specific alpha value.  I know that the
> second derivative of the log-likelihood is used to calculate the standard
> error of alpha, but does anyone know how to retrieve these values (Oksanen,
> Vegan: ecological diversity).
>
> Cheers,
>     Cory
>
> --
> __________________________________
> Cory M. Redman
> Doctoral Candidate
> Texas A&M University
> Department of Geology & Geophysics
> 3115 TAMU
> College Station, TX  77843-3115
>
> Your point of view of the world depends greatly on where you stand and what
> you had to do to get there.
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>
>



More information about the R-sig-ecology mailing list