lunes, 27 de junio de 2016

nichEvolve documentation and code

Here you have some documentation about the nichEvolve model and a link to download the NetLogo code. I will write soon some practical experiments to test with the model... enjoy!
Link:  nichEvolve.nlogo

*(Don't you have NetLogo installed in your computer? NetLogo is a nice tool to implement simple agent-based models, and very useful to introduce yourself in the world of dynamic models!) Download from here: NetLogo


Here is a simple approach to explain how different models of trait evolution can work over one or two different species. Two available models of trait evolution are available in the general framework of Ornstein-Uhlenbeck process, with the possibility of adapting it into a simpler Brownian Motion process by changing the settings.
The model could be usefull as a virtual laboratory to teach about this concepts.

author: Javier Fernandez-Lopez


The model represent the evolution of a single ecological trait that could be defined as "ecological suitability", and could be understood for instance, as a specific requirement of temperature or humidity. The program allows an investigator to observe the effect of changes in each parameter of the Ornstein-Uhlenbeck equation

x(t+dt)= x(t)+ alpha(theta(t)-x(t))dt + (sigma dt E)

which define the evolution through time of a trait, where x(t) is the trait value at time=t, sigma is Brownian motion rate (the amount of random variability of the trait per time), theta is the optimal value of the trait in time=t, and alpha is the selection strengh with which a specific trait value is wanted.

 By changing equation parameters, the researcher can check the evolution of the trait value over time in the graphic box at the right side of the model. The "optimum" boxes show as well the theoretical value of the trait value. If speciation switch is "off", the model represents just one species. When speciation is turned "on", the species is split (red and blue) and the trait evolution occur independently. Now, theta parameter (OU-optimum) could differ for each species.

 Left side of the model shows a espatialy-splicit representation of the model. 200 mobile agents of each colour are shown over a grid that simules different ecological conditions. Remember that if speciation is "off", both colours represent the same species with identical ecological requirements. When the simulation starts, each agent try to find a patch around him that best match with his ecological requirements (theorical optimun niche values). The "realized" boxes show the mean of the values of the environmental conditions that the mobile agents have found by tracking the surronding environment. You can also compare the theorical optimum with the realized niche of mobile agents.

 Following KISS philosophy (Keep It Simple, Stupid!) we have not included some processes as extinction when theoretical and realized niches doesn't match, or reproduction of mobile agents.

 Finally, we have included as an experiment the option of "climate-change". When this switch is "on", it only affects to the spatially explicit representation of the model. The environment value of each patch increases by time, changing the niche availability for the mobile agents and affecting (or not) their distribution. The background process of trait evolution is not affected by "climate-change".


Click "Setup" to initialize the model. Then, you can use "Step" to see how the model runs step by step, or use "Go" button to run the model in a continuous way.

1) Start with a simple Brownian Motion model for a single species (speciation "off"). For this, alpha slide should be 0, theta's values are not important, since alpha (optimum selection strengh) is zero. You could test for changes in graphical box when sigma values are too large or too small.

2) Once that you know the effect of the Brownian motion rate (sigma), you could turn on speciation switch, to split the species. Now you can observe how both species are evolving independently, and, if you are lucky, you could see how their distributions differs from each other in the 2D display.

3) Now you can explore OU models increasing the value of alpha. You can try first using the same theta value for both species and changing it latter. You can also observe how interact Brownian motion rate (sigma) with optimum slection strengh (alpha)

4) Finally you could check the behaivour of mobile agents when climate-change is "on"


 By observing the patterns drawn in graphical box by different combinations of each parameter values, you could think about how difficult it is to guess the actual background process that drives a specific trait evolution if we only know the final state of the values.  


Fernandez-Lopez, J. 2016. nichEvolve: a niche evolution model

domingo, 26 de junio de 2016

nichEvolve, a niche evolution model with NetLogo

 During the last year I was reading some articles about niche conservatism/evolution. There are a lot of theories and methodologies to deal with this kind of questions, but sometimes it's hard to understand all this mathematical and theoretical concepts about models of evolution: Brownian motion models, Ornstein-Uhlenbeck processes, etc. Following KISS philosophy (Keep It Simple, Stupid!) I wrote some code using the wonderful tool NetLogo to develop a very simple model that helps to understand some simple processes related with ecological traits evolution...

 The model implements two usual processes used to describe the evolution of trait values: Brownian motion and Ornstein-Uhlenbeck. While Brownian motion process represents random evolution of a trait value, depending only on Brownian rate (amount of change allowed per time), Ornstein-Uhlenbeck process means directional evolution towards an optimum with a specific selection strength. In the model you can explore diverse combinations of each parameter and observe the results also in a spatial explicit display with mobile agents that track environmental conditions trying to match their theoretical requirements.

 Code will be uploaded soon, so you could modify it and report any suggestion or bug.