coNet: Co-occurrence based interaction network modeling.

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/coNet.R

Description

Generates an interaction network model based on a matrix of co-occurrences (i.e. repeated observations in space). This function is based on the method described in \insertCiteAraujo2011conetto updated to use conditional probabilities.

Usage

1
coNet(x = "co-occurrence matrix", ci.p = 95, raw = FALSE)

Arguments

x

A co-occurrence matrix with observations in rows and species in columns.

ci.p

Interval used for edge removal in percent (e.g. use 95 for a ninety-five percent confidence interval).

raw

LOGICAL: should the original matrix of conditional probabilities, prior to removal of conditional probabilities that are within the removal interval.

Value

An interaction network model in matrix form with "non-significant" links removed and relativized to the marginal probabilities (DEFAULT) or not (raw = TRUE). If relativized, the matrix is the deviation of the conditional probabilities from the marginal probabilities. For conditional probabilities equal to the marginal probabilities, this value is 0. This value can range from 1 to -1, depending on the magnitude of the difference between the conditional and marginal probabilities.

Note

Given a set of repeated observations of variables (e.g. biological species), a network of model of interdependence is estimated using conditional probabilities (P(S_i|S_j)). This is calculated using Bayes' Theorem, as P(S_i|S_j) = \frac{P(S_i,S_j)}{P(S_j)}. P(S_i,S_j) is the marginal probability, the probability of observing species (S_i and S_j), which is calculated from the individual probabilities of each species (P(S)). The total abundance of each species is used to quantify the individual probabilities of each species, such the P(S_i) = \frac{S_i}{N}, where N is the total number of observational units. The joint probabilities are similarly calculated as the total number of co-occurrences divided by the total number of observational units, P(S_i,S_j) = \frac{(S_i,S_j)}{N}. For more details, such as the interval based test, see \insertCiteAraujo2011conetto.

Author(s)

Matthew K. Lau

References

\insertAllCited

See Also

cond_prob cond_net

Examples

1
2
3
4
5
6
A <- c(1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1)
B <- c(1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1)
C <- c(1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1)
D <- c(0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0)
M <- data.frame(A, B, C, D)
coNet(M)

ECGen/coNet documentation built on Sept. 14, 2019, 5:24 a.m.