Skip to content

Stability of an interaction matrix #103

Open

Description

@0xMuluh

Coyte et al. (2015, Science 350:663, doi: 10.1126/science.aad2602) show that communities with many cooperative interactions are less often stable than competitive ones. miaSim builds such communities with randomA(); a function that tests whether the steady state of an interaction matrix is stable would let users run this analysis. Proposed: the eigenvalue criterion (all real parts negative), and Coyte et al.'s criterion as in seqtime::testStability(). Moved from microbiome/miaTime#124.

library(miaSim)
set.seed(1)
stable <- function(A) all(Re(eigen(A, only.values = TRUE)$values) < 0)
A <- replicate(200, randomA(n_species = 20, connectance = 0.4,
    scale_off_diagonal = 0.5, competition = 0, mutualism = 1,
    parasitism = 0, commensalism = 0, amensalism = 0), simplify = FALSE)
mean(vapply(A, stable, logical(1)))
#> [1] 0.435

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions