assessFeedback: Assess feedback characteristics of network

View source: R/evaluate_characteristics.R

assessFeedbackR Documentation

Assess feedback characteristics of network

Description

This function can find all loops or loops of a specific length, and consequently calculate the feedback and loop weight of each loop.

Usage

assessFeedback(
  JM,
  findLoops = FALSE,
  k = NULL,
  output = "allLoops",
  file = NULL,
  scale = TRUE,
  compnames = NULL,
  verbose = TRUE
)

Arguments

JM

(required) Jacobian matrix with interaction strengths.

findLoops

(required) If you want the function to search for loops in your network and store them a file, set findLoops to TRUE. You will need to provide an output name (see output). This function will then redirect to a recursive depth-first-search function to find all loops or all loops of length k (see element k and function dfs() and store them in a textfile. If you already have a text file with the compartments indices of each loop per line, you can set findLoops to FALSE (see element file. Default is FALSE.

k

(optional) Integer Can be used if findLoops is TRUE. It indicates that you only want to search for loops of length k. Default is NULL, which finds all loops if findLoops is TRUE.

output

(required if findLoops is TRUE) String. The name provided in output is used to create the text file name where the loops are stored. Default is "allLoops".

file

(required if findLoops is FALSE) String. This is the path to the text file where the loops are stored.

scale

Default is TRUE: the loop weight will be scaled to the negative self-effects on the diagonal. Scaled loop weight should be used if you also work with scaled stability values. Otherwise set to FALSE.

compnames

(optional) Vector with compartment names in same order as the Jacobian matrix. If it is not included the names of JM are used as compartment names. If the JM is not named, the output will simply include the index of compartments to indicate loops.

verbose

(optional) Default is TRUE. Set to FALSE if you don't want messages printed.

Details

Researching feedback loops in your system can be very informative to understand the system's stability. To find all loops in your system you can use a depth-first-search algorithm (set findLoops to TRUE and k to NULL). Please be aware that increasing the size of your network, exponentially increases the computation time to find all loops. Therefore, if you have a large network you might want to limit your search to loops of length k = 2 or k = 3, as those are found to be the most important in determining overall feedback and stability in your system (Neutel & Thorne 2014).

Feedback of a loop is the product of all interaction strengths in a loop (so feedback is not additive but multiplicative).

Loop weight is defined as the geometric mean of all absolute interaction strengths in a loop of length k. It combines information on the feedback of the loop and the length of the loop. If 'scale' is TRUE the loop feedback is divided by the absolute product of the corresponding self-dampening effects on the JM diagonal. The loop feedback should be scaled in the stability measure is also scaled by self-dampening effects. Depending on your stability measure you can decide to omit scaling.

Value

Returns a dataframe with all loops noted as compName1->compName2->compNamek (column "loop"), with feedbacks (column "fdb") and loop weights (column "lw") of those loops.

References

  • Neutel, A.M., Heesterbeek, J.A.P., Van De Koppel, J., Hoenderboom, G., Vos, A., Kaldeway, C., Berendse, F., De Ruiter, P.C., 2007. Reconciling complexity with stability in naturally assembling food webs. Nature 449, 599–602. https://doi.org/10.1038/nature06154

  • Neutel, A.M., Thorne, M.A.S., 2014. Interaction strengths in balanced carbon cycles and the absence of a relation between ecosystem complexity and stability. Ecol. Lett. 17, 651–661. https://doi.org/10.1111/ele.12266


dswdejonge/fwstability documentation built on Dec. 7, 2022, 7:24 p.m.