bayesjaccard: Community Dissimilarity as Expected or Sampled Beta Variate

bayesjaccardR Documentation

Community Dissimilarity as Expected or Sampled Beta Variate

Description

Jaccard dissimilarity for presence/absence data can be seen as the mode of Beta distributed variate. The function calculates the dissimilarity as a random sample of Beta distribution, or alternatively as its expected value or mode.

Usage

bayesjaccard(x, method = c("rbeta", "expected", "mode"))

Arguments

x

Community data, will be treated as binary.

method

Dissimilarity as a random sample from Beta distribution or as its expected value or mode.

Details

In often-used 2x2 contingency table notation, a is the number of species shared by two compared communities, and b and c are the numbers of species occurring only in one of the compared communities. Assuming uniform prior in (0, 1), the species will “sample” the dissimilarity of two communities with posterior Beta(b+c+1, a+1). This will have mode (b+c)/(a+b+c) and expected value (b+c+1)/(a+b+c+2). The mode is directly the Jaccard dissimilarity for binary (presence/absence) data, and the expected value adds 1 in numerator and 2 in denominator from the prior. The importance of prior will diminish when the number of species a+b+c grows, but it will protect from claiming complete identity or complete difference when we only have a few species.

Function bayesjaccard estimates Jaccard dissimilarity as Beta-distributed random variate, and will return random sample from its posterior distribution. It can also return the expected value or the mode which are constant in function calls.

The function is intended to be used to assess the effect of random sampling variation in community analysis. The natto package provided three examples of its application: clsupport finds the “support” of branches in hierarchic clustering by function hclust, bjNMDS the variation of ordination scores in non-metric multidimensional scaling by functions metaMDS and monoMDS, and bjdbrda the variation of ordination scores of constrained component of distance-based RDA by function dbrda. All these functions find the basic result from the expected value of the dissimilarity, and produce a set of random samples from the Beta distribution to assess the variation in the result.

Value

Dissimilarity object inheriting from classes "dist" and "designdist".

See Also

Function is a wrapper to designdist.

Examples


data(spurn)
## the effect of prior
plot(bayesjaccard(spurn, "mode"), bayesjaccard(spurn, "expected"))
abline(0, 1, col=2)
## one random sample of dissimilarities
plot(bayesjaccard(spurn, "expected"), bayesjaccard(spurn), asp=1)
abline(0, 1, col=2)


jarioksa/natto documentation built on March 28, 2024, 12:45 a.m.