Method to compute trophic levels using graph Laplacian using the method described in MacKay et al 2020.
Usage
compute_TL(metanetwork)
# S3 method for metanetwork
compute_TL(metanetwork)
Value
an object of class 'metanetwork', with computed trophic levels stored as node attribute TL
NULL
Arguments
metanetwork
object of class 'metanetwork'
Details
Let \(A\) be the adjacency matrix of the considered network and \(D\) its degree diagonal matrix.
The Laplacian matrix of the symmetrised network is defined by:
$$L = D - A - t(A)$$
With \(v = indegree(G) - outdegree(G)\) the imbalance degree vector, the trophic level \(x\) is defined as the solution of:
$$Lx = v$$
For a connected network, the solution is unique up to a translation.
We then fix the minimum trophic level value at 0 thus fixing trophic levels of all others species.
Local networks may be disconnected due to sampling effect. In that case, we fix the minimum value on each connected component.
References
MacKay, R. S., Johnson, S., & Sansom, B. (2020). How directed is a directed network?. Royal Society open science, 7(9), 201138.