Back to Article
SuppMat 2: Looking at the ‘traits’ of the different model families
Download Source

SuppMat 2: Looking at the ‘traits’ of the different model families

Author

Tanya Strydom

Published

September 16, 2024

Abstract

The purpose of this document is to provide a rationalisation but also ‘formalisation’ of the different model families of sorts. This starts of by trying to construct a ‘traits’ table that focuses on what the resulting network is (is it a prediction of structure or is it a prediction of interactions), how the resulting network is encoded (i.e., its anatomy) as well as trying to identify what type of data are needed to ‘parametrise’ the model. Finally we take this traits table and feed it into a hierarchical clustering model to sort of see how our broader a priori ideas of models being either topology generators or interaction predictors.

Understanding the rationale of the traits table is perhaps the most crucial thing though so I will try and elaborate on some of the ‘categories’ that I have selected and provide a very high-level glossary of terms. Many of these categories are the product of discussions we’ve hard and this is an attempt to articulate those discussions in a more categorical manner.

First. What the model is predicting. Is it the structure of a network, interactions between species, or their co-occurrence patterns.

Second. What does the network represent. Is it a conceptual network (i.e., cannot be assigned to specific community/geographic location), metaweb (network of potential interactions), realised network, or a ‘metacommunity’ (collection of co-occurring species).

Third. What is the underlying mechanism that determines the interactions between species. This is an attempt at trying to code what is discussed in Box 1 of the main text but a bit more related to the ‘computational’ mechanism and not the ‘ecological’ mechanism. Note here that the use of mathematical is used to refer to a framework that uses some sort of mathematical formalisation to determine interactions/structure, unlike ‘statistical’ which is attempting to find and apply a pattern to determine interactions.

Fourth. What do the links represent - this is much more aligned with Box 1 in the main text

Fifth. What do the nodes represent. Note here that ‘agnostic’ means that there is no node-level metadata for the species/the information at the species level is not ecologically meaningful.

Sixth. The ecological theory as to what constrains links (again Box 1 in the main text)

Seventh. How the interactions quantified

Eight. What are the data sources needed for each model.

In [1]:
suppressPackageStartupMessages(library(tidyverse))
library(gt)
library(ggdendro)

options(warn = -1)

# this is the clustering code
source("scripts/hierarchy_cluster.R")
Saving 7 x 5 in image
trait_tbl <-
  read.csv("data/traits_table.csv")  %>% 
  tibble()

Model family traits table

We can visualise these eight ‘character traits’ as a table

In [2]:
In [3]:

trait_tbl %>% 
  gt(
    rowname_col = "trait") %>% 
  sub_missing(
    missing_text = "") %>% 
  tab_spanner(
    label = "Network generators",
    columns = c(null, neutral, resource, generative)) %>% 
  tab_spanner(
    label = "Interaction predictors",
    columns = c(energetic, embedding, classifiers, matching, expert, scavenging))  %>%
  tab_row_group(
    label = "What is predicted?",
    id = "predicts",
    rows = trait_grp == "predicts"
  ) %>%
  tab_row_group(
    label = "What is the generated network representing?",
    id = "scale",
    rows = trait_grp == "scale"
  ) %>% 
  tab_row_group(
    label = "What is the underlying mechanism that determines links?",
    id = "mechanism",
    rows = trait_grp == "mechanism"
  ) %>%
  tab_row_group(
    label = "What do the links between nodes represent?",
    id = "links",
    rows = trait_grp == "links"
  ) %>%
  tab_row_group(
    label = "Is there information at the node level?",
    id = "nodes",
    rows = trait_grp == "nodes"
  ) %>%
  tab_row_group(
    label = "What type of interactions are predicted?",
    id = "interactions",
    rows = trait_grp == "interactions"
  ) %>%
  tab_row_group(
    label = "What constrains how links are determined between nodes?",
    id = "constraints",
    rows = trait_grp == "constraints"
  ) %>% 
  tab_row_group(
    label = "What data is needed to generate the network?",
    id = "data",
    rows = trait_grp %in% c("data_edge", "data_node", "data_meta", "data_network")
  ) %>% 
  row_group_order(
    groups = c("predicts", "scale", "mechanism", "links", "nodes", "constraints", 
      "interactions", "data"))  %>% 
  tab_style(
    style = cell_text(weight = "bold"),
    locations = cells_row_groups()) %>% 
  tab_style(
    style = cell_fill(color = "bisque"),
    locations = cells_row_groups()) %>% 
  cols_hide(columns = trait_grp) %>% 
  cols_align(
    align = "center",
    columns = everything()) %>% 
  opt_row_striping(row_striping = FALSE)
Traits table for the different model families
Network generators Interaction predictors co.occurance
null neutral resource generative energetic embedding classifiers matching expert scavenging
What is predicted?
structure 1 1 1 1 1 1




interactions



1 1 1 1 1 1
patterns









1
What is the generated network representing?
conceptual 1 1 1 1






metaweb




1 1 1 1 1
metacommunity









1
realised



1


1

What is the underlying mechanism that determines links?
random 1
1







mass_effect
1








mechanistic






1 1

mathematical


1 1 1




statistical





1


1
resources 1 1 1 1






associations









1
energy



1





feeding




1 1 1 1 1
Is there information at the node level?
agnostic 1

1






trophic_spp

1







specific
1

1 1 1 1 1 1 1
link 1 1 1 1






energy



1





forbidden_links




1 1 1 1 1
occurance









1
What type of interactions are predicted?
binary 1 1 1 1

1 1
1 1
probabalistic 1



1

1

weighted



1


1

What data is needed to generate the network?
link 1 1 1







richness 1 1 1







abundance
1

1





traits_other





1 1


phylogeny




1 1



spp_pool
1

1 1 1 1 1 1 1
is_producer



1





traits_size



1
1



network


1
1 1



expert






1 1

published








1

Visualisation

Dendrogram of the trait table using a hierarchical clustering model, This is based off of the traits table in SuppMat 2)

References