This repo contains studies of population dynamics considering a Prey-Predator system composed of Aphids and Ladybeetles, as a case study with the data from the paper of Lin and Pennings.
To model the Predator-Prey behavior, we consider a system of ordinary differential equations (ODEs) based on a structure of Lotka-Volterra. This setup can be easily configured in our jupyter notebook
s provided in this repo.
We have applied Bayesian calibration for the model's parameters.
To document results and for the sake of reproducibility, we use jupyter notebook
s. We provide a requirements.txt
file in case you want to have the same
development environment we have (for instance, you can create an environment with venv). We use Python >= 3.6
.
For the utilized packages, see the requirements.
Open the notebooks folder. You will find seven codes .ipynb:
-
model1.ipynb to model3.ipynb These codes contain the routines for the three employed phenomenological models (model 1, 2, and 3). The routine includes (i) loading the data, (ii) data regularisation, (iii) sensitivity analysis, and (iv) Bayesian calibration.
-
model4.ipynb to model6.ipynb These codes contain the routines for the three data-driven models (model 4, 5, and 6). The routine includes (i) loading the data, (ii) data regularisation, (iii) sensitivity analysis, and (iv) Bayesian calibration.
-
ModelSelection.ipynb This code performs the model selection after getting the results from the two previous codes. Each model has Maximum a Posteriori (MAP) estimates for the calibrated parameters. We manually insert the values in the model, for example for model (1):
R, C = N
dNdt = [ r1 * R - a1 * R * C / ( 1 + a2 * R ),
ef * R - m * C * C ]
it becomes:
dNdt = [ 0.318752 * R - 0.080779 * R * C / ( 1 + 0.0001948159776916025 * R ),
0.0002897334690674872 * R - 0.012509 * C * C ]
After filling in all models, the user can run the code and will get a ranking from worst to best.
To test another mathematical model not listed, the user should directly change the definition of an existing model, which is indicated by the prefix "def" (this is a function of Python). All the parameters should also be modified throughout the code to be consistent with the new model to be added.
Open a terminal and type:
-
Open the data_driven_model_identification folder. You will find two subfolders whose scripts are used to discover models 4, 5, and 6. The identification of models 4 and 6 uses the same scripts but different GPR (Gaussian Process Regression) kernels for the data regularisation.
-
Enter the directory of the model you would like to run.
-
Clean the project's output folder:
$ make clean
- Run the project by writing the output logs to the terminal:
$ make
OR
Run the project by writing the output logs to the models.dat file:
$ make run_output
- Enter the project's output folder and check out the results.
MIT license. Check LICENSE for further details. Spoiler: you can use it at will, as well as distribute, modify and etc. But without any warranty, at your own risk.
- Diego Volpatto: dtvolpatto@gmail.com
- Lucas Dos Anjos: lucas.ecol@gmail.com
- Gustavo Naozuka: gtnaozuka@gmail.com