trophic_incoherence: Trophic Incoherence Parameter

View source: R/network-summary.R

trophic_incoherenceR Documentation

Trophic Incoherence Parameter

Description

The trophic incoherence parameter q is a measure of how "vertically ordered" a directed network is (Johnson et al. 2014). For each edge (u, v), the trophic difference is x_{uv} = s_v - s_u where s_i is the trophic level of node i. The trophic incoherence parameter is the (population) standard deviation of these differences:

q = \sqrt{\frac{1}{|E|} \sum_{(u,v) \in E} (x_{uv} - \bar{x})^2}

Usage

trophic_incoherence(x, cannibalism = TRUE)

Arguments

x

Directed network input.

cannibalism

Logical. If FALSE, self-loops are removed before computing trophic differences. Default TRUE.

Details

Low values (q \approx 0) indicate a perfectly coherent network (e.g., a pure food web where every edge goes up one level). High values indicate an incoherent network with many level-skipping or downward edges. Johnson et al. 2014 showed that low-q food webs are dynamically more stable.

Matches networkx.trophic_incoherence_parameter at machine epsilon. Directed-only; requires at least one basal node (node with no incoming edges) for trophic levels to be well-defined.

Value

A single numeric value (NA_real_ for empty edge sets or undirected input).

References

Johnson, S., Dominguez-Garcia, V., Donetti, L., & Munoz, M. A. (2014). Trophic coherence determines food-web stability. PNAS, 111(50), 17923-17928.

See Also

centrality (the trophic_level measure) for the per-node levels used in the incoherence calculation.

Examples

# Small directed 3-node chain: 1 -> 2 -> 3 (perfectly coherent, q = 0)
adj <- matrix(c(0,1,0, 0,0,1, 0,0,0), 3, 3, byrow = TRUE)
rownames(adj) <- colnames(adj) <- c("A", "B", "C")
trophic_incoherence(adj)

cograph documentation built on May 31, 2026, 5:06 p.m.