Showing posts with label research. Show all posts
Showing posts with label research. Show all posts

6.5.14

Less haste, more speed.

Todays lesson is a harsh one. Less haste = more speed.

Time and the again I find myself with a significant set back in running simulations due to some stupid, pathetic, rage-inducing idiotic mistake that if I had just taken an extra second to think about things and run through the logical steps of the programme, I could have very easily avoided it!

You would think, after 4 years of doing this that I would have learnt my lesson. But no. Here I am, with less than a month to go and I have just found another completely moronic mistake in model settings that means my lovely model output is now all wrong and has to be re-done. Whats worse is that to was actually *TWO* mistakes, leading to more food in the landscape and more individuals being introduced into the model so that I had a lovely stable long-term population.

I fixed the errors and my population now dies by year 30. This itself is fine, as it actually what I would have expected in the region I'm modelling, but what it does mean is that I now have to re-do the focus of my last chapter, re-think the order of experimental steps, re-think the implications for real-world conservation and what this means for interpretation and future recommendations for conservation management. *aarrgghh*

Some days I wonder how I've managed to survive into my thirties. I think I might just walk around with a giant DUNCE written on my head and be done with it.

Not a good day when I have 4 weeks and counting to hand in the final thesis!

Breathe. Think. Take a second. Fix the error. Check. Check. Double check. Look at the fix. Check it again. Breathe. Look at Facebook. Look at Twitter. Check. Check. .... Run....

(fingers crossed......)

4.2.14

Completion of example model data chapter

So its been a while since my last blog post. On a personal note I have been busy with Christmas and my young daughter and we have also just moved house again - all of which have distracted me from doing the finishing touches to my PhD. I have also just applied for a NERC grant with cardiff University. That was a terrific amount of work in a short space of time, for which I am not going to know the outcome until June!

With all that going on, I'm surprised to have got so far with things.

To make a general update:

I have now completed my third data chapter - the big beast of a chapter that describes my entire model in detail and publishes the model outcomes, sensitivity analysis and validation with empirical data. What a feat! At every turn I felt like mistakes were arising and the model seemed to crash every time I tried to improve things and make output more ecologically realistic. But time waits for no-one and some sage advice form my supervisor has allowed me to close the door on the continually effort for improvement and concentrate on getting it done and moving on to the landscape analysis.

Some bits and pieces from this chapter:

1. territories and population size. females in red, males in blue.



population remains fairly stable, increasing slightly to fill the useable space and has some good stats for individuals inside and outside of the protected areas. agents are younger in the matrix than inside the protected area, have lower energy reserves and less fecundity.

2. Population stats, protected vs non-protected areas



I still have some issues with validation via the empirical data with the number and distribution of agents being captured by model camera traps not matching the empirical data. The fine and local scale movement of agents does not seem to be adequately captured by the model, but considering the landscape scale nature of the simulation and the scale of movements and number of individuals, then its not surprising to get some scaling issues. A higher resolution landscape and were individuals would allow for a bit more work to be done in this area, but this was not the focus of the piece of work so I'm not too worried. As long as the population level events are being captured, and match the empirical population data then I believe we can be happy with the outcome of the model so far.

Its not my intention to get a model that fully encapsulate the complexity of real individual jaguar movements, as this is going to be pretty much impossible. The need to reduce model complexity, but increase model realism is always going to be a battle. We just have to hope that we reduce model complexity in the right places that model outcomes are not adversely affected. 

The next, and last(!) chapter of my thesis will take a look at this by using the model to investigate connectivity and landscape utilisation in a population of jaguars in a far more fragmented area of Belize.  This should give me a better idea of the issues with the model and how these need to be addressed (if any exist).

For now, I'm pleased to have got this chapter done and happy to be moving onto the last phase of my PhD. The end is in sight!

29.11.13

Model fail.. reasons unknown

Todays post is mainly just a summing up of model results following some recent analysis that has shook the foundations of my trust in my model.

As it turns out, when you have a complex model, analysing results can be complex and assigning blame to any particular parameter/process can be even more challenging.

I've been happily plodding along in the knowledge that I finally have my model churning out some decent results, with the right things happening at the right time in the right places. One final analysis has turned this on its head with the finding that territory sizes are not properly linked to food resources. I have suspected this has been the case for some time, but following the reduction of food resources outside of the protected area I find that male territories in the matrix are about 3/4 the size of territories inside the CBWS forest. Females surprisingly are the reverse, but I think this is mainly due to most females being driven out of CBWS due to avoidance of males. In the matrix it seems they are able to expand their territories and are not so constrained due to the presence of fewer males. The average size of their territories is also unfeasibly small inside CBWS and nowhere near the size that would be needed in the real world to maintain a single individual....

crap.

So it seems a pretty fundamental feature of my model is not working as it should and I am at a pretty big loss as to why this might be the case.

Looking at males, they are attracted to trails, and attracted to male pheromones on trails. This causes larger territory sizes as they move along trails, pop out further into the forest and create new areas to call their own. Individuals are seemingly not linked to any particular area and territories are completely transitory. I wonder whether this is the problem? Males, due to this feature, also exhibit larger territory sizes when there are more males around, presumably because they get drawn onto trails. However, having a process that allows males to move further along trails causes a population crash in pretty short time (i.e. around year 20 of the simulation). I'm not quite sure why, but I'm doing some tests to figure out if the number of moves makes any difference to the fate of the population.

Looks like I might have to go back to the drawing board.

This is not the news I wanted with 6 months left on my PhD!

What do I want:
Males move along trails where possible
Males follow other males along trails, for some suitable distance.
All individuals have larger territories outside of the protected area as they need to move more to consume sufficient food resources
Females avoid males but generally their territories are overlapped to a large extend by males
Males move much faster along trails
Males move much faster when following a female to mate
All individuals would prefer to be inside the protected area


21.10.13

Jaguar population model parameters

So I haven't updated this for a while... I've been busy re-doing most of what I've spent all of this year doing. VERY frustrating!

Basically, after finishing my PhD transfer report I showed my work (all the output from my jaguar population model) to my collaborators in Belize - researchers who have been working with jaguars for years, I found that some of the key outputs from the model were not close enough to realistic values for jaguar populations in the wild. Namely, territory sizes and the distances that individuals moved over time. Those things that seemed pretty critical to the emergence of a stable population size. In fact, upon initial attempts to increase territory sizes, my stable population became stable no longer. Hence, I've spent the last 3 months re-doing all the tedious trial and error work I did during the previous 3 months in trying to get a stable population size over time that exhibited more realistic individual behavioural characteristics.

I've just about finished doing all the work and getting all the output. Ive harnessed the power of 2 computers at the university to do the bulk of the simulation work which I have managed to get remote access to. This has made the whole thing a lot easier as I don't have daily access to the computers in person. This has also freed up my own computer to do some other work - the work I should have been doing over the past 3 months instead of re-doing the population model.

So, perhaps I am jumping the gun a bit here as I have yet to fully analyse the output or run it past my field collaborators, but these are the current model parameter settings. First is the least-cost model, and food availability:



 Next comes the agent parameters, dictating the agent behaviours and life history traits:


Then comes the interaction parameters:


In short, parameters I've changed are:
  • the *number of time steps per day* - from 4 to 10; 
  • the *number of cells males can move when trying to find a female to mate with* - from a maximum of 10 to a max of 25;
  • the *pheromone degrade rate* -  to 0.08;
  • the *cost of male pheromone to a female* - from p to 0.3*p;
  • the *cost of a male pheromone to another male, if the males are on a trail* - from p to -0.001*p;
  • *food availability* outside of Cockscomb protected reserve - reduced to 85% of the availability inside CBWS;
  • addition of a *post-model setup* period - the initial 10 years (including the 3-year startup period) describe a reduced mortality for all adults, allowing greater time for the population to find suitable territories.
Initial analyses give male territories from around 40 to 70km2 and females around 10-20km2. These seem much closer to realistic sizes. Population sizes also seem to settle around 70-120 in number which also seem pretty good for the location.

These settings also seem to generate larger numbers of individuals being captured by the static model camera traps. Original stats gave an average of around 5 per sampling period versus the 191 collected in the field which is pretty bad. The new settings don't give anything near 191 either, but closer to an average of around 20ish.

Some other points:
  • Females undergo typical reproductive rates, being available to mate only for the central third of their oestrus cycle;
  • sub-adults leave the mother aged 2 and undergo a single year of 'dispersal' during which time they can move freely within their mothers range, are reproductively inactive and experience a higher mortality rate;
  • dispersal is therefore an emergent feature of the model and not hard-coded.
We'll see what the final analysis looks like soon and take it from there.

5.6.13

The first spatially-explicit agent based model of jaguar population dynamics

The chapter is done! After over a year working on building and developing an agent-based model of jaguar population dynamics I have finally finished tinkering, got my results, analysed and interpreted and written up the chapter for my thesis. I officially handed it in over southampton uni's electronic tracker system yesterday and my relief was palpable!

The unofficial deadline I proposed to my supervisors back in January was 15th March(!). But of course delays and problems along the way have caused this deadline to overrun by a mere 3 months. This of course puts the rest of my thesis in a bit more jeaopardy but I feel like the last few months have been a massive learning curve and have been well worth the endless hair-pulling and 'throwing my computer out of the window' in frustration events. Sort of...

I now feel like I have a decent-ish model of the large scale population dynamics of jaguars. Territories are strongly correlated with population size which is a nice validation that things are working as expected. Territories are also pretty much the size that would be expected, although a little on the small side if truth be told. I have found it incredibly difficult to obtain a true territory-resource relationship so that territory sizes are not imbedded in the code of the model, but rather an emergent feature. I still think more work could be done here and I will continue to develop this further as time goes on and I get some more feedback from a larger variety of people.

Some results from my model are shown below. Population size is reduced within the first 10 years and then stabilises. 

Territory sizes of males (blue) and females (red) increases with smaller population sizes.

Territory sizes increase over the first 10-20 years and then stabilise. The decreasing trend correlates with the increasing trend in population size.

A snapshot of the simulation after the first 3 years showing clear territories of individuals (coloured areas - different colours equate to different individuals) - all shown on a habitat map of the area.


A full map of the landscape used can be seen below showing a range of different habitats, the outline of the protected area and the camera traps.



Validation of the model with field data was a bit iffy at first glance. Field data captured 191 jaguar sightings, the model captured an average of 5 per data collected period. But discrepancies are mainly due to the models inability to capture the fine-scale social-oriented movement of individuals. In the real world males are known for making 'information-gathering' expeditions along trails to find out who has been around and when, with sub-adult males known to follow older male for short periods. This has not been included in the model, but its generally thought to be a non-fitness function and not thought to affect territory dynamics or the contact/interactions between individuals.

I can't of course display all the results and discussion from the model outputs just yet as I'm currently trying to update the chapter for submission to a publication. Once its been submitted and reviewed I will then make it openly available! 

Open-source information for all.

10.7.12

Outline of Thesis (July 2012)

A recent meeting with my supervisors generated some good discussion about where my PhD is going and what I should be thinking about in terms of my final PhD thesis.
Having already been mandated to complete both a 6-month and a 10-month report, I feel like I have the bare bones of my thesis laid out already, with some chapters and details requiring further definition.

As of this week, my thesis already comprises a introductory chapter (literature review) and two data chapters. Im currently working on the third data chapter which I expect to finish in time for the upcoming transfer report and viva. With this in mind, and following clarification of what I hope to achieve by the end of my PhD, my thesis will be as follows:

1. Introductory chapter - to be completed. A short 5-8 page introduction to project and motivation/methods.
2. Literature Review - completed, but needs refining.
3. Exploring and Integrating Least-Cost Models and Agent-Based Simulations in Fragmented Landscapes - completed, but needs some refining to aid potential publication
4. An Agent-Based Model of Jaguar Movement Through Conservation Corridors - completed and published.
5. Integrating and Validating an Agent-Based Model of Jaguar Movements with real-life GIS and Camera-Trap Data Collected in Cockscomb Basin Wildlife Sanctuary, Belize - currently in progress
6. Analysis of real-world corridor designs based on an agent-based model of jaguar movements in Belize - next step, transferring validated jaguar model to corridor area in central belize.
7. An analysis of the potential future impacts of increased human activities and major environmental events on jaguar movements in Belize - last step given enough time (!), Potential impacts and factors are wide-ranging and will depend on discussions with Bart and Beccie and findings from previous work.
8. General Discussion - final section, generally quite short - 6-8 pages, covering limitations and implications of current work and section of future work (although this needs to be specific and achievable).

Chapters 3, 4, 5, 6 and 7 are data chapters. Chapter 7 is best-case scenario and I would like to get this far, but some of this may be combined into chapter 6 if there is not enough time for a stand-alone chapter.

Some sample pages from my thesis to date.....









21.6.12

model decision-making part 2

Movement Decisions

As an update to my post entitled model decision-making (17/01/2012, here), i've changed my mind yet again (!) on the best way for my agents to move around.

Food is by far the most logical incentive, but then 'cost' became an arbitrary factor that counted for nothing real and only worked in making the model use more factors for no apparent reason. The only way I could see around this was to incorporate food and mortality into the cost factor - as was originally intended when I chose to centre my ABM around ideas of least-cost modelling.

so now, my agents make movement choices based on:

  1. road cost
  2. habitat cost
  3. pheromone cost
Food is still available in the cell, depending on the habitat at that location, but a propensity to avoid cells recently inhabited (via the amount of pheromone available) means that agents are directed at cells that are likely to have greater food availability.
Basing movement decisions on habitat and pheromone implicitly include aspects of food, cover, mortality, mating opportunities etc rather than having to specifically include each separate detail in the model.

This makes more sense to me, and reduces the complicatedness of the model. This has become a real issue to me as improving the model tend to naturally lead to an ever-increasing array of parameters and choices and extra code.

Where a road exists, this overwrites the habitat cost.

Feedback and Improvements

I've also had a lot of good feedback from Bart and Beccie, out in Belize, and I hope to incorporate their ideas and suggestions for improvements in subsequent drafts of the model. At the moment, I have simplified some of the habitats (by combining some types of forest together) and simplified the roads to 3 types:
  1. large, regularly used tarmac roads
  2. small, infrequently used non-tarmac roads that allow cars to pass
  3. small trails and tracks inside and outside cockscomb including some pedestrian tracks that have no car use


Interactions Between Agents

At the moment of writing (june 2012) I'm having trouble deciding how best males and females should interact and how best to attract females and males together for appropriate mating opportunities. I seem to have 4 distinct types of interactions that update how the agents view pheromones from other individuals:
  1. own strength - so how strongly individuals interact with their own pheromones
  2. avoidance of males - how strongly females interact with male pheromones (generally they should try to avoid males so as not to be harassed, although this changes when they are in heat and ready to mate, but could potentially be more severe an avoidance if she is pregnant or has cubs?)
  3. mating attraction - how strongly females should be attracted to male pheromones when they are in heat and ready to mate
  4. male mating attraction - how strongly males should be attracted to females when they are in heat and ready to mate
Additional issues arise when males sense a female is ready to mate, as they are likely to stop actively hunting and looking for food and may become quite thin in their pursuit of a mating opportunity. Males also cover more distance per day when searching for a female in heat.

I'm currently running some trial simulations looking for the effects of these pheromone parameters on the territory sizes of males and females, and in the number of individuals that die and are given birth to. It seems the interaction between these various parameters may be causing some unexpected results in my data.

Territory Sizes

Lastly, territory sizes are become a real concern to me. Territories are based on the number of cells that have an individuals pheromone located in them. Two separate parameters dictate how pheromone survive and propagate - pMax (the maximum amount of pheromone deposited in a cell when visited by an agent) and pDegrade (the rate at which the pheromone degrades and eventually disappears). 

My initial trials used pMax of 100 and pDegrade of 0.98, which gave stable territory sizes of around 70-100 cells per individual. Of course, it wasn't until I realised that this was a tenth of the size that territories needed to be that I ran into a problem!

This needs some more work and investigation, and at the moment any combination of settings seems to either generate territory sizes that are still too small, or that steadily increase throughout the simulation (presumably territories would stabilise at some point but too much time is required for them to stabilise for the parameters settings to be effective).

Running the model for 5000 ticks (or around 4 years) currently takes around 15-20 minutes in batch mode and I would rather not wait any longer before proceeding with the intricacies of the model and starting to collect some data.... although its looking increasingly likely that this may be the case.

17.1.12

Model Decision-Making

Ok, so following on from the 'model dilemma' post, I have decided, rather than choosing between the two separate movement decision options, to combine them together.

So, instead of having my agents move around looking for food and ignoring the type of habitat, they now make a decision based on 4 factors:

1. amount of food
2. habitat cost
3. pheromone cost
4. road cost

Decisions are now based on a weighting of these 4 parameters, with the need to move still driven by food requirements, but the decision inherently based on weighing up pros of food availability vs the cons of habitat/pheromone/road cost (which implicitly include a range of other factors that may be important to movement decision making by jaguars).

A total 'cell quality' value now exists for each neighbour and the jaguar choose the cell with the best cell quality, calculated as follows:

cellQuality = food - (0.1*habitatCost) - (0.1*pheromoneCost) - roadCost

Food is explicitly linked to habitat, with the food reaching a maximum of 10 in good quality preferential forest habitats.
habitatCost and pheromoneCost reach a maximum level of 100 and so are multiplied by 0.1 to standardise the relative values to that of food. 
roadCost is a tricky one, I haven't yet decided whether to go to a maximum cost of 10 here or to 100, to provide a better relative difference between road types..... The main tricky aspect here is that I want to encourage males to use the trails (classed as a type of road) but discourage the females from doing the same. In this way, males view the smaller forest trails as either of no cost or negative cost (TBC) whereas females see them of some low cost value.

This method of combining the food and cost decision making loops takes out around 3/4 of the steps required in the food loop, making only one additional step to the cost loop - a biased choice towards maximising food if the jaguar has low food reserves. 

Adding in different costs for the trails also provides some inherent decision making towards using trails or not, versus the hard-coding probabilistic choice to avoid or prefer trails that was used in both the food and cost loops.


12.1.12

Publication

My jaguar model has been published via the European Conference on Artificial Life, at which I also presented the work.

Details:
Watkins, A., Noble, J. and Doncaster, C. P. (2011) An agent-­based model of jaguar movement through conservation corridors. In:Advances in Artificial Life, ECAL 2011: Proceedings of the Eleventh European Conference on the Synthesis and Simulation of Living Systems, pp. 846-853, MIT Press. ISBN 978-0-262-29714-1
found here

ECAL took place 8th to 12th August 2011 in Paris, France.

11.1.12

Jaguars: the next step

So what I should have explained by now is that I've moved on from the initial 'lets get a model of jaguar movement in an abstract world working' to "lets validate how jaguars move around in a real-landscape using real data'.

But I should first add some results from the initial 'abstract' model. Not only are territories clearly defined (see post 'habitat preference and territory development' from september '11) and habitat preferences clearly working, but I made a first attempt to investigate some questions about landscape-level population effects of fragmentation and landscape structure. I outlined the model in brief in a previous post ('1st jaguar simulation model' from november '11) and chose to focus on two key questions:

1. What is the effect of landscape structure on the population?
2. How well do corridors connect discrete habitat patches?

So, to answer question 1. I looked at the 'happiness' of individuals in the population over the 9 different landscape designs. 'Happiness' here is defined as the inverse of the cost per time step per individual, where cost is defined as the combination of cost of the habitat (via the least-cost model) and cost of encountering another individuals territory (defined via 'pheromones' which are deposited when an individual moves into a cell and degrade over time). The lower the cost per time step, the happier the individual.


Figure 1. The mean cost per time step for populations within each of the 9 landscapes.

The primeval design is the clear winner here, but this tells us nothing interesting. This design is all forest and so tells us nothing about the effect of landscape structure on the population. By removing this from the figure, we see the results much more clearly:


Figure 2. The mean cost per time step for populations within each of the 8 landscapes that have some amount of matrix habitat.

Now we can see that there is a much clearer difference between those landscape with a corridor and those without. But what is really noticeable is that the happiness of the population relies on how much pure forest habitat there is rather than the structure of the landscape. The Random Islands design includes island of forest that are so small, they are effectively all edge and so this landscape contains less pure forest than all of the other landscape except for the No Corridor design.

To answer question 2. I looked at the proportion of individuals that were able to migrate from one side of the world to the other, in short, the proportion that started in one habitat patch and ended up in the other. This represents the ability of the corridor design to facilitate movement of individuals through the landscape.

Figure 3. The proportion of individuals that moved from one side to the other by the end of the simulation.

Again, clearly the primeval landscape wins, but that tells us nothing interesting. There are no barriers to movement in this design. But there is clearly some big differences between the other 8 landscapes. In fact there is a three-fold difference in the proportions vs a 10% difference found when looking at the happiness of individuals. Clearly, it is the ability to facilitate movement across the landscapes that really differentiates  landscapes in terms of their structure. Connected corridors (represented by One Corridor, Three Corridors and Five Corridors) all increase the proportion of individuals that successfully switches sides during the simulation. What is interesting is that there is such a big difference between these three corridor designs. This surprised me at first until I started to think more about the problem.

One big fat corridor limits the ability of an individual to randomly find it, given that individuals are spread through the entire forest block. Having more corridors increases the chances that any individual will find it. Not only this, but having a corridor that is large enough to support resident individuals means that others may be prevented from travelling through the corridor. It seems to me that the optimum corridor design differs depending on what you want to maximise. A single fat corridor may be fine if you simply want to increase the amount of habitat available, but multiple narrower corridors that reduce the potential for resident individuals to setup territories within the corridor itself may maximise the potential for individuals to travel and increase migration between habitat patches.

It appears there then becomes a trade-off between maximising habitat and population size potential and maximising flow of individuals between habitat patches.

Conclusion
In conclusion, my findings so far suggest that not all landscape structures/corridor designs are the same and that the critical feature for maximising happiness/fitness of a population is to increase the amount of preferred habitat, no matter where this habitat is (with certain constraints on size of patches to be expected here). However, the key difference between corridor designs and in fact landscape structure per se, is the ability to promote and facilitate migration of individuals from one habitat patch to another. This is enhanced with a design of physically connected corridors that are more numerous and narrower in design (again given certain limits due to edge effects/territory size of the species in question etc).

Model Dilemma

So now my model is nearing completion (sort of), I have one main dilemma.

Following a presentation of my work to fellow biologist/ecologists, it seemed that what people wanted to see what a motivation for why individuals move around, rather than simply hard-coding them to move around x% of the time. This meant a shift away from the least-cost model to something more intuitive - food.

At first glance, this seems a relatively straight-forward shift to make. Now, instead of individuals choosing a location based on some negative cost value (and opting for the least-cost move) now they would move around according to their food requirements. In principle, the landscape-effect is similar. Forest is still good whilst agricultural areas/urban areas etc are not so good. However, the shift to 'emergent' behaviour, i.e. individuals moving around to meet some food requirement involves quite a lot of behind the scenes work within the code itself. To put in brief, the two flowcharts outline the decisions made by individuals within each given scenario, 1. moving to find enough food and 2. moving according to least-cost principles. Circles in red are decisions, those in thick red are standard default decisions.




Pros and Cons

1. Food
Now it becomes clear, whilst moving for food may be more intuitive and more 'realistic', it is a lot more complicated, involving a large number of additional parameters, is more likely to cause some un-conceieved bias in the results, and hence is far more sensitive to initial conditions and far less robust that a simpler movement process. There is also no explicit recognition of mortality risk, protection, mating opportunities, physiological costs etc that are encompassed with the single cost value used in the least-cost model. In short, the only factor affecting where a jaguar moves is the availability of food.

In addition, mortality risk is modelled separate to movement choice. Individuals are not 'aware' of the mortality risk of any particular location and are unable to choose a location according to this risk. Of course, this could be added as another factor, but this would increase the complexness of the model, add further parameters and make it even more sensitive.

Some additional parameters include:
1. Amount of food required by an individual (per step or as an average per day still to be decided)
2. Reduction in food per time step - should this be different depending on if the individual physically moves compared to staying in the same cell? should there be a reduction per time step and another depending on how the individual moves? Should this be a set amount or a proportion of the total food resource/food required per step/day?
3. Increase in food availability in cells that have been visited by a jaguar - should this be proportional, an incremental increase or a logistic increase? - i.e. type I, type II or type III response to predation?
4. Should the food be homogenous or clumped/variable in distribution?
5. Should the food change in spatial representation over time?




2. Cost
But then again, cost doesn't necessarily make the best option either. Here, whilst the model decision making is simple and straight-forward there is now no motivation for individuals to move. Movement is not 'emergent' but hard-coded. Males move x% of the time, females y% of the time. However, there is much less risk of the model being sensitive to initial conditions as there are only two parameters to be concerned about: relative differences in cost between habitats and movement rates for males and females.

In addition to this, movement decisions are now based on a range of factors, implicitly outlined by the cost of any particular habitat. Not only does food get represented in the cost, but also mortality risk, cover, mating opportunities, physiological costs of moving through the terrain.

1.11.11

Habitat preference and territory development

Getting jaguar agents to mimic real-life individuals and create territories is one of the most important features to try and get right in this type of agent-based model.

Exploring the way jaguars move through landscapes involves understanding how they interact with each other and with the environment. Territory formation and avoidance (or not) of conspecifics are integral to getting these interactions to be as close to mimicking those found in real populations as possible.

So.... some kind of pheromone seems that it should elicit an easy territory response in the agents. 'Marking' each cell with some level of pheromone as the agents move into and out of the cell and then allowing this 'pheromone' to degrade over time should allow territories to organically emerge during the simulation and with a bit of tweaking as to how quickly the pheromones should degrade and how 'strong' they should be to other individuals and to themselves.

The main idea is that individuals should not want to re-trace their steps too often, and that generally individuals should try and avoid each other - either due to possible conflicts between adults and due to resource depletion.

We know a bit about how large and flexible territories are in wild jaguar populations and so we settled on a maximum pheromone level of 100, with a degradation rate of 0.98, so that the pheromone reduced by 0.02% each timestep. This gave realistic territory sizes.

The strength of the pheromone is equal to its level, except for an agents own pheromone which is reduced to 0.15% of its current level; a deterrent to re-entering the cell but not enough to mean that the individual would not want to re-treat to its territory if meeting another individual or unsuitable habitat was the only other option.

The addition of pheromones, and the basic least-cost model idea of the simulation led to the following output, where clearly define territories (individuals in different colours) and habitat preferences can be seen:



Some individuals have been 'pushed' out of the forest area due to the population size. This is intentional. A higher number of individuals creates stress for any single individual. Without some level of stress, individuals will be content on remaining in fairly isolated areas. Some stress is needed in order for individuals to move and seek new areas in which lead a lifestyle of least-cost, so prompting the migration of individuals from one side of the landscape to the other.

20.9.11

1st jaguar simulation model

With my case study involving complicated landscape structures and real-world scenarios, I needed to first get to grips with getting an agent-based model of jaguar movements up and running in a simplified landscape that would enable some interpretation of population dynamics without the need for an in-depth and overly detailed landscape.
After discussing several options, a very abstract and basic landscape structure was decided on to try to answer some fundamental questions important to my on-going research:

1) Can we get a model of jaguar movements working, with plausible daily movements and territory sizes close to those found in real world populations?

2) Does landscape structure seem to influence the way jaguars move around the landscape and does it affect the fitness of individuals and the population as a whole?

3) Can habitat corridors help to increase the connectivity of the landscape and facilitate movement of individuals between habitat patches?

9 landscape structures were defined to help explore these questions, including 3 control landscapes (top row), 3 connected corridors (middle row) and three non-connected corridors (bottom row) :




'Good' habitat here is forest (in green). This is where jaguars will prefer to be. Intermediate habitat is marked in blue, and represented edge habitat; the edge of the forest that meets the non-forest habitat. This is deemed to be less desirable than the forest itself but more desirable than the non-forest habitat. Non-forest (matrix) is coloured beige, and represents any habitat where the jaguar do not want to be; urban areas, agricultural land, roads etc etc.

Landscapes were designed to cover a range of potential options. All designs (bar the first two; the all forest and the 2 distinct habitat patches) have exactly the same amount of forest and matrix habitat. Edge habitat changes depending on the design of the landscape.

The model is designed as a grid, with individual jaguars occupying any one grid cell at a time. Least-cost methodologies are employed so that each habitat has a cost; forest of 1, edge of 5 and non-forest (or matrix) as 25. This represents the strength of the preference of jaguars to any habitat (lower cost equals a much stronger preference).


Next post - more information about jaguar movements and getting territories to develop.













14.9.11

Jaguars as a case study

Ok,

So now I have all things technical working and sorted I can continue discussing my actual work :)

I've mentioned that my work has its roots in ongoing fieldwork in Belize. My target species is the Jaguar: an apex predator, the third largest feline in the world (behind the lion and the tiger) and a probable keystone species: the jaguar plays an important role in stabilising and controlling the ecosystems in which they are found.


Jaguars were historically found from the southern United States to northern Argentina, although this range has been reduced but up to 40-50%, with much of the existing area more highly fragmented and vulnerable to disturbance.



Territories of typical individuals range from approximately 10-40km2 for females to 30-80 km2 for males. Density varies a lot, with maybe 0.2 per 100km2 in some areas of Brazil to 8-10 per 100km2 in the Cockscomb Basin Wildlife Sanctuary in Belize.

The main reasons for this flexibility and variability in density and territory size is thought to centre around prey density and availability and amount/quality of habitat.  Belize has some of the highest density of Jaguars throughout its entire range.

Jaguars are, in their own right, deserved of conservation efforts. However, with their large ranges and daily movement requirements (up to 4km in a single day), any effort to conserve habitat for jaguars will lead to extensive biodiversity preservation, with numerous species and vegetation communities protected within the cats range.

The jaguar can therefore be viewed in the basic sense as an indicator of the quality and extend of suitable habitat in any landscape. My modelling efforts use the jaguar as a case study, to promote jaguar conservation itself but also to address larger scale ecosystem function and resilience questions.








24.6.11

PhD - first step

So first year over, now its on to some new research.


My first thought was, where do I go next?

My PhD is aimed at a real-life problems. My case study is a corridor area in Belize, in central america.

The issues remain the same as with the hedgehog work. How do mammals move through the landscape? How will increased habitat fragmentation affect the movement of mammals through the landscape? How do we measure landscape permeability? How can we best model the effects of landscape structure on the movement of mammals in a landscape?


These questions have huge implications on the persistence of populations in a landscape and on the amount of disturbance and development that a landscape can absorb before a population reaches a threshold tipping point. My research is really focused on questions surrounding ecosystem function and resilience.
"To halt the decline of an ecosystem, it is necessary to think like an ecosystem."
- Douglas P. Wheeler, EPA Journal,September-October 1990
The overall goal of my research is to attempt to understand how a species views and interacts with its environment. Exploring these issues and gaining some understanding of the relationship between animals and their environment can help us understand ecosystems function and how anthropogenic processes may affect ecosystem processes.

15.6.11

Final thoughts on Netlogo model

I was really happy with how things turned out with my first foray into agent-based modelling.

My friend Melissa first got me interested in Netlogo and I have to say it was a perfect choice for a short-term relatively simplified and low-level model. I avoided the necessity of having to learn a new programming language as I found the netlogo language easy, intuitive and quick to pick up.

I would recommend anyone new to programming or agent-based modelling to start with something like Netlogo to break yourself in gently.

Some negatives, however, obviously I am no expert at netlogo modelling, but my first experience left me feeling that the scope of the language was limited and that if I wanted to explore some more complicated and detailed modelling options then I would need to progress to a language that allowed me more freedom. The level of automatic generation of output and ready-made agents and patches makes netlogo an ideal starting point, but not necessarily an ideal language to really start exploring what agent-based modelling can do.

next post: java

13.6.11

Netlogo models

Ok, so now I've tested some least-cost models against empirical data of hedgehog dispersal I can use the best-fit least cost model as the basis for some exploratory agent-based simulations.

Luckily there was one clear winner in the least-cost model analysis so I can be fairly confident that this provides a good fit to the way that hedgehoge actually view and move around the landscape. With this in mind I simplified things abit by reducing the number of habitat types from 22, from the original GIS maps, to 7 in the simulations. Whilst this sounds dramatic, it was logical and simply meant lumping all water features together into a single habitat, all urban features together etc. Most of the habitats that we lumped together were given the same cost value anyway, but to clarify, this is how I simplified the landscape:

The proportions of each landscape were for the most part arbitrary, although were estimated from the original GIS maps.

So.... Netlogo. The building of the model was fairly straightforward. Netlogo is brilliant at making it easy to get something up and running fairly quickly. Turtles represent agents and the simplified language and syntax of netlogo makes it really easy to get the turtles to move around in a random direction at every time step.

Of course, by using the least-cost model as a base, turtles were amended so that they searched the cells in their immediate neighbourhood and moved to the cell of the least cost. Sample code is below:

to move-hedgehog
  ask hedgehog[pen-down]
  ask patches [set visit visit - 1]
  ask hedgehog [
      face one-of neighbors with-min [cost]
      forward 1]
end

The biggest problem I faced with the enitre netlogo model was how to construct the landscape. It is easy to generate different habitats by stating which cells to be of which colour(habitat). What is much harder to get a landscape to develop on its own, randomly each time the simulation is run, and then for the landscape to represent some level of fragmentation. This was particularly tricky and get me and my supervisor busy for a while in coming up with suitable ideas. In the end, we 'seeded' the habitats, so that each habitat started at a random cell and moved outward to neighbouring cells. If the cell it wanted to convert to its habitat is alreayd assigned it jumps to a free random cell on the landscape.

Netlogo code (this was done for each of the 7 habitat types):

to expand-habitatarable
  ask arable [
    if all? patches [pcolor != black] [stop]
    if Harable = 0 [stop]
    ifelse all? neighbors [pcolor != black]
      [move-to one-of patches with [pcolor = black]
        set pcolor color
        reduce-colours]
      [ifelse all? neighbors4 [pcolor != black] [
         move-to one-of neighbors with [pcolor = black]
         set pcolor color
         reduce-colours
         ][
         move-to one-of neighbors4 with [pcolor = black]
         set pcolor color
         reduce-colours]
         ]
  ]
end

the method to used to call the habitat methods:

to expand-habitats
  ifelse (Harable = 0) and (Hpasture = 0) and (Hwood = 0) and (Hgarden = 0) and (Hwater = 0) and (Hurban = 0) and (Hroad = 0) [stop] [
    expand-habitatarable
    expand-habitatpasture
    expand-habitatwood
    expand-habitatgarden
    expand-habitatwater
    expand-habitaturban
    expand-habitatroad
  ]
end

Fragmentation was achieved by swapping cells with other random cells at a given probability. 50% probability of swapping leads to 100% fragmentation. (The definition of fragmentation is actually really difficult to find so this is a good enough demonstration for these purposes):


The extension to the model involved giving the hedgehogs a bit more realistic behaviour, so instead of simply choosing the nearest cell with the lowest cost at every step, they mimicked real hedgehogs by choosing habitat depending on the time of day: i.e. during the daytime, they preferred cover (forest) as they would in reality in order to rest, and during the night time they preferred areas where they could feed (pasture, gardens etc):

to move-hedgehog-day                        
  ask hedgehog [pen-down]                  
  ask patches [set visit visit - 1]
  ask hedgehog [ 
    ifelse pcolor = brown
       [stop]
       [face one-of neighbors with-min [cost]
        forward 1]
      ]                        
end

to move-hedgehog-night                      
  ask hedgehog [pen-down]
  ask patches [set visit visit - 1]
  ask hedgehog [
    if (pcolor = green) or (pcolor = lime) [stop]
    ifelse any? neighbors with [pcolor = lime] [
      face one-of neighbors with [pcolor = lime]
      forward 1][
        ifelse any? neighbors with [pcolor = green] [
          face one-of neighbors with [pcolor = green]
          forward 1][
            face one-of neighbors with-min [cost]
            forward 1]
      ] 
  ]                                  
end

I'm currently trying to find a way to upload the netlogo model as an applet and will post it when I can. The code to the full model can be found in the links on the left.
In a nutshell, by looking at the average cost of a path taken by any hedgehog in any landscape, if you look at the hedgehogs that move simply by least-cost pathways, the average cost of path increases dramatically as the landscape becomes more fragmented. If you look at the hedgehogs with some differentation between night and day, then there average path cost stays more or less the same with any level of fragmentation:


Fig 1. a) Simple hedgehogs,                                               b) hedgehogs with day and night preferences










If there are any questions about Netlogo, or how to specifically code for similar process as I've outlined here then please get in touch.

9.6.11

Validation using empirical data and GIS datasets

Before I start with my first attempt at an agent-based simulation in netlogo, I need to explain the point of the work.

My summer project is entitled, "Modelling mammalian movements in fragmented landscapes: exploring and integrating least-cost models and agent-based simulations".


The general idea was re-implement a study already published (Driezen et al, 2007. Evaluating least-cost model predictions with empirical dispersal data: A case-study using radio-tracking data of hedgehogs. Ecological Modelling 209: 314-322) and then extend the study by creating an agent-based simulation with which to add additional realistic behaviours to 'hedgehogs' to see if this extended our ability to understand and explore the way hedgehogs move around the landscape.


I got involved with this paper as one of my supervisors (Patrick Doncaster) collected the data for the original study, rather than because I have any particular interest in hedgehogs (although they are pretty cute!).

Least-cost models essentially give a value to each habitat type in a landscape. The model is species-specific and generated from expert knowledge of how the species in question views the landscape. Values represent the cost of being in that habitat, with low values indicating preferred and more suitable habitats and high values indicating non-suitable habitat or that which may pose the greatest threat to the species (for example roads, water, arable land or urban areas may be examples of 'costly' habitats depending on the species in question). These models assume that individual move to areas that are of low cost.

The data was collected from several areas in and around Oxford, UK. GIS maps of these areas were supplied from one of the authors (Frank Adriaensen at the University of Antwerp) but the rest of the analysis was done by attempting to re-implement the statistical analysis of a number of least-cost models as detailed in the Driezen paper.

12 models were generated, each providing a different set of values for the habitat types found within the study areas.

Hedgehog locations were recorded as data points and overlaid on the GIS maps.

By amending the attribute table of each GIS raster dataset, the cost of each habitat could be added to the GIS layer. ArcGIS has good functionality and so an in-built function to generate a cost layer was used to create the leats-cost model from the original habitat map.

Each hedghog was released from a fixed location and this was used as the reference point for analysis. As you can see below, concentric circles were generated using each release point as the centre and each observed location from the release point as the radius. The spatial analyst extension in ArcGIS was used to generate summary statistics for each circle, from which a comparison between cell costs could be made and a z-score calculated from which to perform some quite complicated statistical analyses (look to later posts for reference and discussion on stats etc).

Fig 1. Original habitat map showing one hedgehog path and concentric circles used to score each least-cost model, on the left. On the right, an example least-cost model with concentric circle. As the cost of the landscape increases the colour changes from brown (low cost) to blue(high cost). The path taken by the hedgehog is shown in red:








The cost of the cell in which the hedgehogs were located was then compared to the costs of all the other cells located on the edge of that same circle. If the observed location cell cost is lower then average then it means the hedgehog is located in a relatively lower cost habitat. The lower the cost, in comparison to the average cost per circle and per individual hedgehog, the better the least-cost model is in explaining how hedgehogs move around the landscape.


By doing this same analysis for all of the regions and all 22 hedgehogs for which we had data, one least-cost model produced the best fit to the data. (In this case it was resistance set 10).

My results were different to those found by the original Driezen study and least-cost models seem sensitive to selection of empirical datasets. However, the selection and generation of least-cost models to test seemed random and arbitrary and perhaps more thought and a a full sensitivity analysis may provide more confidence in the selection of the most suitable least-cost models.

next post: extension to this work: using least-cost modelling in a simplified agent-based simulation in Netlogo.