Skip to content
Prev 998 / 7420 Next

null models with continuous abundance data

On 07/01/2010 21:48, "Etienne Lalibert?" <etiennelaliberte at gmail.com> wrote:

            
Yes, you're right that care must be taken to
of unique random matrices must be obtained. I
problem in my case given that transforming my
to count by

mat2<- floor(mat * 100 / min(mat[mat >
can quickly lead to a very large number of individuals (hundreds
thousands if not > million in some cases). The issue then becomes
one of computing speed, but that's another story.

Following your
algorithm that starts with
then fills it randomly. It seems to
extremely slow. 

In addition, because the
time, I sometimes ran into the
nowhere to go because "ressources" at the
already full. In that case, this individual
nowhere. This is a bit drastic and clearly sub-optimal,
only way I could quickly think of yesterday to prevent the
from getting stuck. The consequence is that often, the total number
individuals in the null matrix is a bit less than total number
individuals in the observed matrix.

Etienne,

This is the same problem as filling up a binary matrix: you get stuck before
you can fill in all presences. The solution in vegan::commsimulator was
"backtracking" method: when you get stuck, you remove some of the items
(backtrack to an earlier stage of filling) and start again. This is even
slower than initial filling, but it may be doable. The model application of
backtracking goes back to Gotelli & Entsminger (Oecologia 129, 282--291;
2001) who had this for binary data, but the same idea is natural for
quantitative null models, too. The vegan vignette discusses some details of
implementation which are valid also for quantitative filling.

I would like to repeat the serious warning that Carsten Dormann made: you
better be sure that your generated null models really are random. P?ter
S?lymos developed some quantitative null models for vegan, but we found in
our tests that they were not random at all, but the constraints we put
produced peculiar kind of data with regular features although there was
technically no problem. Therefore we removed code worth of huge amount of
developing work as dangerous for use. I do think that also the r2dtable
approach is more regular and less variable (lower variance) than the
community data, and you very easily get misleadingly significant results
when you compare your observed community against too regular null models.
This is something analogous to using strict Poisson error in glm or gam when
the data in fact are overdispersed to Poisson. Be very careful if you want
to claim significant results based on quantitative null models. Would I be a
referee or an editor for this kind of ms, I would be very skeptical ask for
the proof of the validity of the null model.

Cheers, Jari Oksanen
problem with the large matrices I'll deal with though, but
something to be aware of.

If you're curious, here's the simple
run a test below. I'd be very interested to
algorithm!

Thanks again

Etienne

###

nullabun <-
require(vegan)
   nsites <- nrow(x)
   nsp <- ncol(x)
colsum <- colSums(x)
   nullbin <- commsimulator(x,
rownull <- rowSums(nullbin)
   colnull <-
rowsum <- rowsum - rownull
   colsum <- colsum - colnull
ress <- rep(1:nsites, rowsum)
   total <-
selinds <- sample(1:total)
      for (j in 1:total){
sitepot <- which(nullbin[, indsel] > 0)
sitesel <-
ress <- ress[-which(ress ==
nullbin[sitesel, indsel] <- nullbin[sitesel, indsel]
}
      }
return(nullbin)
}


### now let's test the
# create a dummy abundance matrix
m <-
byrow=TRUE)

# generate a null matrix
m.null <- nullabun(m)

# compare
sum(m) #30
sum(m.null) #29: one individual got
# to generate more than one null matrix, say
nulls <- replicate(n = 999, nullabun(m), simplify = F)

# how many unique
length(unique(nulls) ) # I found 983 out of 999

# how many
sum(m) # there are 30

# how bad is the problem of
in null matrices?
sums <-
hist(sums) # the vast majority
Le jeudi 07 janvier 2010 ? 10:34 +0100, Carsten