Posted by proopnarine on June 23, 2009
There continues to be a lack of clarity of the role of interaction strengths in stabilizing ecological communities. Most of the empirical and theoretical work done suggests a predominance of weak links. Strongly coupled species tend to have oscillatory or pseudo-oscillatory interactions, but weak links to stable species may tend to dampen, or reduce the amplitude, of the oscillations. The extent to which this is true, given a large and complex network of a species-rich system, remains unknown. Perhaps one way to explore this is to examine network robustness, CEG-style, while manipulating interaction strengths in the following way:
- Topological extinction with no link strengths, i.e. all links are of equal and static strength.
- Current CEG-style link strengths, where in-link strengths for a species are all equal. Strengths would be static.
- Same as above, but strengths are now dynamic, reflecting compensation for lost links.
- Same as previous two options, but now repeat with
-distributed link strengths, both static and dynamic.
Posted in CEG theory | Tagged: beta distribution, edge strength, interaction strength, link strength, networks | Leave a Comment »
Posted by proopnarine on April 28, 2009
A new project involves working with the CEG model and coral reef communities. The main goal is an interactive and instructive module for education, but there’s no reason why the data could not be used for some research also. The exercises are to model the impacts of coral bleaching, and reduction/removal of higher trophic-level fish from the system. Now CEG specifically models potential secondary extinction of species, but it occurs to me that one of the major impacts that we observe on reefs is the decline of corals as dominant or co-dominant benthic cover. This is usually accompanied by an expansion of macroalgae with which the corals compete for space. So the model is being modified to examine the impact of the manipulation of trophic networks (food webs) on the spatial state of the reef (along with secondary extinctions, of course). You can read a bit more about this here.
Assume that the community begins in equlibrium (with regard to spatial competition) at time 0 (
). If the relative population size of species i is
, then equlibrium is expressed as

where
is a competition coefficient (not a constant), and there are n competing species. Therefore,

Because population sizes are changing in response to non-competitive factors (trophic), we expect changes to relative population sizes, and hence the coefficient is dynamic. Hence the difference equation governing relative population size during a CEG cascade becomes
![N_{i}(t) = \frac{ K_{i}(0) \left [ I_{i}(t) - O_{i}(t) \right ]} {K_{i}(t)} N_{i}(t) = \frac{ K_{i}(0) \left [ I_{i}(t) - O_{i}(t) \right ]} {K_{i}(t)}](http://s3.wordpress.com/latex.php?latex=N_%7Bi%7D%28t%29+%3D+%5Cfrac%7B+K_%7Bi%7D%280%29+%5Cleft+%5B+I_%7Bi%7D%28t%29+-+O_%7Bi%7D%28t%29+%5Cright+%5D%7D+%7BK_%7Bi%7D%28t%29%7D&bg=fafcff&fg=2a2a2a&s=0)
where
is the same for all competitors, and need be computed only once per cascade step.
Posted in CEG theory | Tagged: competition, coral reef, corals, food webs, Tipping point | Leave a Comment »
Posted by proopnarine on April 28, 2009
In making some minor modifications to the main simulation program, CEG-1.4.8, I encountered a compile error using gcc 4.3.2-7. The system is 64-bit AMD based, running Fedora 10. gcc was installed from the rpm package gcc-4.3.2-7.x86_64. The simple compile command g++ -o CEG-1.4.8-SMP CEG-1.4.8-SMP.cpp yielded the following output:
CEG-1.4.8-SMP.cpp: In function ‘int main(int, char**)’:
CEG-1.4.8-SMP.cpp:75: error: ‘strcpy’ was not declared in this scope
CEG-1.4.8-SMP.cpp:114: error: ‘strcpy’ was not declared in this scope
CEG-1.4.8-SMP.cpp:281: error: ‘strcpy’ was not declared in this scope
Given that these lines refer to fairly old parts of the code, and that compilation has been successful for years, I suspected that either there is a bug in this version of gcc, this latest RH update to its gcc package, or that my code is no longer legal. It seems to be the latter, and using strcpy is not really a good idea anyway. Here’s an example of the offending code (all uses referred to file reads from command line arguments or opening files for output):
//open existing matrix file specified by user
do
{
strcpy(matrix_name,argv[2]);
std::cout << "\nName of network matrix file: " << matrix_name;
matrix_file.open(matrix_name);
}
Note the use of strcpy in the fourth line. Simply replacing the routine worked. Here’s a correction:
//open existing matrix file specified by user
do
{
const char *matrix_name = argv[2];
std::cout << "\nName of network matrix file: " << matrix_name;
matrix_file.open(matrix_name);
}
Posted in Code | Tagged: c++, Code, strcpy | 2 Comments »
Posted by proopnarine on March 19, 2009

100 Beta variates from example in text.
Our problems are to (1) draw random variates from various beta distributions, (2) embed the code in the “parallel” SMP version of CEG, and (3) pass the beta variates to CEG simulations. After exploring a number of different ways to generate the variates in C++, notably using the GNU Scientific Library, I’ve decided to simply use an Octave script. The syntax is very easy, and because the C++ simulations are embedded in a Bash script, it’s really easy to simply generate the variates and have C++ load the output files. Here’s the basic Octave script:
#! /bin/octave -qf
#Generate beta variates;
arg_list = argv ();
a = str2double(arg_list{1});
b = str2double(arg_list{2});
c = str2double(arg_list{3});
x = betarnd(a,b,c,1);
disp (x)
This script is run by the following Bash script:
#! /bin/bash
beta_file1=$4
echo $beta_file1
octave -q $1 $2 $3 >$beta_file1
The Bash script is called with command line parameters, namely the parameters for Octave’s betarnd function (a, b, and number of variates; the last parameter is 1, since output is a vector). A call would therefore look like this:
./beta.sh 2 5 100 beta_output1.dat
where beta.sh is the Bash script, the distribution being called is
(2,5), and 100 random variates will be generated. The output is re-directed to output file beta_output1.dat. Don’t forget to make your script executable with chmod +x beta.sh
Posted in Code | Tagged: beta distribution, Code | Leave a Comment »
Posted by proopnarine on February 26, 2009
The objective here is to establish the degree of similarity between successive communities, in spite of changing taxonomic compositions and diversities, and ecological/guild diversity.
Let
represent an ecosystem over time (e.g. the Karoo series) comprising a series of chronologically successive communities,
The metanetwork representation of
is identical for all
if guild diversities are omitted. That is, the unparameterized metanetworks are automorphisms
Species-level networks (slns) are generated from the parameterized metanetworks, a finite set for each one. The question being addressed here is, how many of those slns are isomorphic between metanetworks? In other words, how many of a community’s networks are identical to networks in the preceding and succeeding communities? This is a very important question from the perspective of CEG dynamics, because in the model equivalence of ecological dynamics can transcend taxonomic composition and identity. Consider the two slns in the first figure. Specifically they are different, but dynamically they will respond identically to perturbation. This isomorphism extends to the guild level also. Imagine for a moment that the species in the figure are actually different guilds, and that guilds 2 and 3 are very different organisms. IF guild diversities permit the generation of slns with the same numbers of links, then isomorphic slns will be generated. Furthermore, we can remove any guild and species identity completely from the networks and maintain an equivalence of CEG dynamics under the following condition: If the perturbed species/nodes are part of a connected subgraph, and the connected graph is isomorphic with another subgraph, then CEG dynamics of the two networks will be identical! A minimum measure, therefore, of the continuity of ecosystem dynamics between successive communities, is the number of slns that are isomorphic between the sln sets.
Unfortunately, determining whether two graphs or networks are isomorphic is an NP-complete problem, and slns are very complex graphs. Given the size of the sln sets for each community, it would be impossible to determine the power of their intersection. Given that CEG dynamics are drawn however from the likeliest region of the sln space, that is, stochastic draws are made from defined trophic link distributions, we are really interested in establishing isomorphism of those subsets, not the entire sln space. So, one procedure would be to generate a set of high probability slns from each community, and then test those for isomorphism. The test would have to be one of elimination, i.e. whittling down the number that could be isomorphic, without ever actually arriving at the number that are isomorphic. But that would give us an upper limit of the number that could be isomorphic, and an upper limit on the measure of similarity between the two communities. In the next post I will outline an MCMC approach to generate sets of slns with high likelihood.
It is entirely possible that the result will be that no networks are isomorphic between communities. In that case, it would be obvious that, given similarity of CEG dynamics, the networks are “close enough”. We would then be faced with the even more difficult task of measuring minimum distances between networks, but this is not at all an impossible task. We’d just need some reasonably powerful computers, and acknowledge the fact that our carbon footprints would far outweigh any benefits to be gained from our work.
Posted in CEG theory, NSF proposal | 3 Comments »
Posted by proopnarine on February 7, 2009
Given any species level topology
where
represents edges or links, and
represents vertices or species, the probability of that specific topology is the probability of the set of interspecific links specified or composing the topology. Therefore, the probability of the network, given metanetwork
is

where the right product is the probability of any species
having a particular pattern or topology of links to other species, and the left product is the product of those probabilities for all species in the community. We can see immediately how the probability of any particular species-level food web is built from the probabilities of individual species networks.
The number of species-level networks that can be derived from a metanetwork depends upon permutations of all possible combinations of link topologies of species in the community, and is generally an astronomical number for even a modest number of species and guilds. The network with the greatest probability, or maximum likelihood of occurrence, is one where the probabilities in the formula above are maximized. This can be approximated if one considers that the probability of
being linked to any
is equal, regardless of the in-degree of
One can therefore consider the probability of linking to any
to simply be the proportion of the predator’s set of prey species that is represented by
These are simply maximum likelihood estimates of the metanetwork link probabilities.
The in-links of each species are assigned randomly to species in other guilds for which a metanetwork in-link exists, i.e. those other guilds comprise potential prey of the species, and
where the species belongs to guild
The resulting network may be represented as a
adjacency matrix,
where
is the total number of species in the community. Binary entries
indicate whether species
is prey to species
Furthermore, row sums,
equal the in-degree of species 
The probability of a species
link topology,
or the binary pattern of the row
is the product of the probabilities of each link. This can be calculated efficiently as the multinomial probability of a pattern of links spread among the guilds. Say that the probability of a link between
and a species in guild
is equal to the fraction of the diversity of
prey that is represented by the species richness of
then the probability of
is

where
is the number of
links to species in guild
is the species richness of
and
is the total number of prey potentially available to
according to metanetwork
, where
It is important to note that each term in the formula exists iff
i.e. a metanetwork link exists
This prevents the inclusion of zero probabilities. Finally, the overall probability of the network is calculated as
the product of all species probabilities, which in turn are the products of all link probabilities.
Posted in CEG theory | Tagged: likelihood, network theory, networks, probability | Leave a Comment »
Posted by proopnarine on February 5, 2009

This is another rendering of the San Francisco Bay food web (see below) using a different drawing algorithm. This view arranges guilds hierarchically instead of in a circular fashion. It is very interesting to note that “layers” roughly equivalent to trophic levels emerge naturally from the data. Primary producer guilds are at the bottom, and top predators at the top!
This figure was rendered by Rachel using AT&T’s Graphviz dot algorithm.
Posted in Visualization | Tagged: food webs, modeling, network theory, networks | Leave a Comment »
Posted by proopnarine on February 4, 2009
Now that’s complex! This is a rendering of the metanetwork for the San Francisco Bay food web. The network consists of 163 nodes, each node being a guild. In total, they represent ~1,600 species of invertebrates and fish, as well as four nodes representing various types of autotrophic producers. There are 5,024 links or trophic interactions between the guilds. The dataset currently excludes birds and marine mammals. Those data are being incorporated even as I type! So, when faced with this level of complexity, how does one determine if the system is resilient, or vulnerable to the removal or addition of specific types of species, or can withstand the effects of climate change?
The figure was produced by one of my graduate students, Rachel Hertog, who has done a tremendous amount of work on this project, as well as the Dominican Republican paleocommunities. The data come almost entirely from the collections of the California Academy of Sciences, notably the Dept. of Invertebrate Zoology & Geology, and the Dept. of Ichthyology.
Posted in Visualization | Tagged: connectance, food webs, networks | 1 Comment »
Posted by proopnarine on February 1, 2009
Posted in Uncategorized | Leave a Comment »
Posted by proopnarine on January 28, 2009
The number of species-level food webs, or variations of the community (such as the web shown in the previous post) that can be derived for the Miocene marine community, comprising 130 heterotrophic species grouped into 25 guilds (plus for autotrophic guilds) is:

That’s much larger than the paltry
or
particles estimated to make up the known Universe! I can feel the weight of my Hindu ancestry here. A very nice discussion of large numbers can be found in The Biggest Numbers in the Universe. Therein is listed an old favourite of mine from The Hitchhiker’s Guide to the Galaxy: “Space is big. Really big. You just won’t believe how vastly hugely mind-bogglingly big it is. I mean, you may think it’s a long way down the road to the chemist, but that’s just peanuts to space.”
So just how meaningful is all the possible community network variation? One caveat to the answer is that primary productivity is specified in the network as units of productivity, and not actual species. So there are actually a total of 1320 nodes representing primary production in the network, and those certainly contribute significantly to the huge number. But let’s say we reduce those nodes to simply one for each producer guild, resulting in substantially smaller species-level networks. The number of possible networks is now

That’s still pretty big!
Posted in CEG theory | Tagged: food webs, network theory, networks | Leave a Comment »