So I've once again bit a bit silly trying to output a lot of data in as simple a manner as possible from my Repast model. This means I have 500 files, for every run (20) that I now need to analyse.
I've figured out that the easiest method for doing this is to concatenate the files together. These files are intended for me to analyse how agents are moving around the landscape, and if any movement is occurring from south to north, or vice versa.
The easiest method for this seems to be via the terminal on my Mac, and a great, simple and straightforward method is as follows:
Open /Applications/Utilities/Terminal.app
Type 'sort ' (without the quotes, note the trailing space, and do NOT press return)
Drag the file(s) that you want to sort to the terminal window
type '> sorted.txt' (without the quotes)
Press return. Sort will read the files, sort them and put the sorted list into the file called 'sorted.txt' in your home directory.
Easy peasy!
My PhD research on spatially explicit modelling of habitat permeability for mammalian wildlife
7.3.14
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.
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
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:
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:
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.
Subscribe to:
Posts (Atom)





