skembel / picante

R tools for integrating phylogenies and ecology
33 stars 17 forks source link

Difference between richness and sample.pool null.model in ses.mpd/ses.pd/ses.mntd ? #22

Closed gowachin closed 3 years ago

gowachin commented 4 years ago

Hello,

I need to use ses.mpd function with minor modifications. To do so, I looked at the function and I have a question about the null model in the switch part of ses.mpd (I noted it's the same for ses.pd and ses.mntd).

What is the difference between the richness and the sample.pool null model, as its the same code in both cases ?

mpd.rand <- switch(null.model, taxa.labels = t(replicate(runs, 
        mpd(samp, taxaShuffle(dis), abundance.weighted = abundance.weighted))), 
        richness = t(replicate(runs, mpd(randomizeMatrix(samp, 
            null.model = "richness"), dis, abundance.weighted))),
        frequency = t(replicate(runs, mpd(randomizeMatrix(samp, 
            null.model = "frequency"), dis, abundance.weighted))), 
        sample.pool = t(replicate(runs, mpd(randomizeMatrix(samp, 
            null.model = "richness"), dis, abundance.weighted))), 
        phylogeny.pool = t(replicate(runs, mpd(randomizeMatrix(samp, 
            null.model = "richness"), taxaShuffle(dis), abundance.weighted))), 
        independentswap = t(replicate(runs, mpd(randomizeMatrix(samp, 
            null.model = "independentswap", iterations), dis, 
            abundance.weighted))), trialswap = t(replicate(runs, 
            mpd(randomizeMatrix(samp, null.model = "trialswap", 
                iterations), dis, abundance.weighted))))

It's said to be different in the help.

richness Randomize community data matrix abundances within samples (maintains sample species richness) sample.pool Randomize community data matrix by drawing species from pool of species occurring in at least one community (sample pool) with equal probability

After tests, I assume the richness null.model does what is described in the help, but not the sample.pool option.

I have the 1.8.1 version of picante installed from CRAN.

Maxime Jaunatre

Jez-R commented 3 years ago

I've just noticed the same thing and came here to ask this exact question (picante 1.8.2)

richness = t(replicate(runs, mpd(randomizeMatrix(samp, null.model = "richness"), dis, abundance.weighted))), sample.pool = t(replicate(runs, mpd(randomizeMatrix(samp, null.model = "richness"), dis, abundance.weighted))),

skembel commented 3 years ago

Hi, sorry for the slow reply. You are correct that these two null models are actually doing the same thing. The reason for presenting them as separate options is for historical reasons - in the literature, there were studies that aimed to randomize communities while maintaining richness ("richness"), or that aimed to randomize communities while drawing the same number of species from the sample pool ("sample.pool"). However, these two null models are ultimately doing exactly the same thing. I will modify the text in the help file to be clearer about this, thanks for your suggestions.