Introduction

Quick review of other packages available

if (!exists("db")){db <- tools::CRAN_package_db()}
mdf <- data.frame(Package = db[, "Package"], 
                  Title = db[, "Title"], 
                  Description = db[, "Description"])
net.pks <- mdf[grep("network", mdf[, "Description"], ignore.case = TRUE), ]
coo.pks <- net.pks[grepl("co-occur", net.pks[, "Description"], ignore.case = TRUE), ]
as.character(coo.pks[, "Package"])

EcoSimR: what methods for network modeling? What Bayesian methods?

Araujo method

Methods

Overview

  1. Calculate pairwise conditional probabilities $P(S_i|S_j) = \frac{P(S_i,S_j)}{P(S_j)}$
  2. Calculate variances $V(S_iS_j) = N * E[P(S_i,S_j)] * (1 - E[P(S_i,S_j)])$
  3. Confidence interval $CI_{95\%} = E[S_iS_j] * Z_{95\%} * \sqrt{V(S_iS_j)}$
  4. Edge removal $If CI_{l} \leq [S_iS_j] \leq CI_{u}, then P(S_i|S_j) = P(S_i,S_j)$
  5. Re-scaling $D_{ij} = P(S_i|S_j) - P(S_i,S_j)$

Pairwise Conditional Probabilities

Edge Removal and Re-scaling

![Lichen interaction networks were constructed by conducting field observations in 1 cm$^2$ cells within a 10 cm$^2$ grid on each tree using a checkerboard pattern (grey cells). Thus, a set of $N$ total cell observations were recorded for each tree with the presence or absence of each species recorded for each cell. Applying the probability-based network modeling method adapted from [@Araujo2011], we calculated the conditional probabilities, $P(S_i|S_j)$, for all species pairs and removed (i.e. set equal to zero) species pairs whose joint probabilities, $P(S_i S_j)$, were not significant using a confidence interval based comparison of their observed co-occurrence frequency, $S_iS_j$, to that expected due to chance alone, $E[P(S_iS_j)] = P(S_i) P(S_j)$, and $P(S_i|S_j)$ reduces to $P(S_i)$, the observed individual probability of species $S_i$.](img/lcn_araujo_method.pdf)\begin{figure}[ht]

Results

A simple example using data from Keith et al. 2010.

dat <- read.csv("../data/arth09.csv")
## 
dat <- dat[, -1:-2]
dat[is.na(dat)] <- 0
dat[dat != 0] <- 1
## 
pb.cn <- conetto::coNet(dat, ci.p = 99)
pb.cn <- pb.cn[apply(abs(pb.cn), 1, sum) > 0, apply(abs(pb.cn), 2, sum) > 0]
spp <- rownames(pb.cn)
rownames(pb.cn) <- colnames(pb.cn) <- 1:nrow(pb.cn)
pb.ig <- igraph::graph_from_adjacency_matrix(abs(pb.cn), mode = "directed", weighted = TRUE)
pb.btw <- igraph::betweenness(pb.ig, normalized = TRUE)
names(pb.btw) <- spp
igraph::plot.igraph(pb.ig, vertex.size = (pb.btw*100)^(0.85), 
            vertex.label.color = "black", 
            vertex.boarder.color = "white",
            arrow.size = 0.1)

Discussion

Citations

Acknowledgments

References



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