[R] fisher.alpha warnings
Jari Oksanen
jari.oksanen at oulu.fi
Fri Mar 22 12:08:45 CET 2013
Kulupp <kulupp <at> online.de> writes:
>
> I have two vectors (a and b) with counts of animals and wanted to
> calculate fisher's alpha:
>
> library(vegan)
> a <- c(2043, 1258, 52, 1867, 107, 1624, 2, 157, 210, 402, 5, 107, 267,
> 2, 13683)
> b <- c(2043, 1258, 52, 1867, 107, 1624, 2, 157, 210, 402, 5, 107, 267,
> 2, 3000)
> fisher.alpha(a)
> fisher.alpha(b)
>
> fisher.alpha(a) gave the following warnings:
>
> > fisher.alpha(a)
> [1] 1.572964
> Warnmeldungen:
> 1: In log(p) : NaNs wurden erzeugt
> 2: In log(1 - x) : NaNs wurden erzeugt
> 3: In nlm(Dev.logseries, n.r = n.r, p = p, N = N, hessian = TRUE, ...) :
> NA/Inf durch größte positive Zahl ersetzt
>
> fisher.alpha(b) gave no warnings (note: only the last number in the
> vector 'b' differs from 'a'!)
>
> Why did vector 'a' gave warnings and what does that mean for the
> validity of the calculated alpha-value?
>
Dear Kulupp,
It gives the warning because it uses non-linear iterative methods in solving
Fisher's alpha, and it took too long a step so that at one stage it studied
negative alpha. That gives a warning. In general, it may be difficult to say how
this influences the results. It seems that in this case the initial estimate of
the starting value of alpha was too high, and the next iteration was
over-corrected to a negative value. It also seems that the estimation recovered
from this bad step.
It is difficult to say when there is no need to worry. However, if you use
fucntion fisherfit() instead of its wrapper, fisher.alpha(), you can plot the
profile close to the solution:
plot(profile(fisherfit(a)))
The profile() function may be able to find cases where the solution was really
bad and a better solution could be found nearby. In this case the situation
looks good.
Best wishes, Jari Oksanen
More information about the R-help
mailing list