hab: Calculate Shannon diversity of all transitions.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/hab.R

Description

Calculate measures of transition diversity using the Shannon index. Note that the formulas are conditional to omit zero probability values from the calculation.

Usage

1
hab(jd)

Arguments

jd

A matrix indicating the joint distribution across all interactions of X and Y in the form:

p(x,y) Y
0.06 0.06 0.06 ...
X 0.14 0.14 0.14 ...
0.12 0.12 0.14 ...
... ... ... ...

Details

Element-wise multiply matrix jd by logarithm base 2 jd and sum.

∑ -p(x_i,y_j) * log2 p(x_i,y_j) = -p(1,1) * log2 p(1,1) + -p(1,2) * log2 p(1,2) + … + -p(i,j) * log2 p(i,j)

Value

Returns a value indicating the Shannon diversity of all transitions.

Author(s)

Bjorn J. Brooks, Lars Y. Pomara, Danny C. Lee

References

PAPER TITLE.

Examples

1
2
3
4
5
6
7
8
data(transitions)             # Load example data
b <- brkpts(transitions$phenofr, # Find 10 probabilistically
            10)                  #  equivalent breakpoints
m <- xt(transitions,          # Make transition matrix
        fr.col=2, to.col=3,
        cnt.col=4, brk=b)
jd <- jpmf(m)                 # Joint distribution
hab(jd)                       # Shannon diversity

bjornbrooks/landat documentation built on May 17, 2019, 7:32 p.m.