Skip to content
forked from volpatto/pdeco

Welcome to the repository for the mathematical models and code associated with the research paper 'A New Modelling Framework for Predator-Prey Interactions: A Case Study of an Aphid-Ladybeetle System' published in Ecological Informatics in 2023. This repository provides the source code and data used in the study.

License

Notifications You must be signed in to change notification settings

Tungdil01/pdeco

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDECO: Study of population dynamics with ODEs for Ecology problems

Try it out in your browser: Binder

What is it?

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.

How is the mathematical model?

To model the Predator-Prey behaviour, 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 notebooks provided in this repo.

How the models are implemented?

We have applied Bayesian calibration for the model's parameters.

To document results and for the sake of reproducibility, we use jupyter notebooks. 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.

Required packages

For the utilized packages, see the requirements.

How to use (and modify) the code?

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.

How to run the data-driven model identification codes?

Open a terminal and type:

  1. 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.

  2. Enter the directory of the model you would like to run.

  3. Clean the project's output folder:

       $ make clean

  1. 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

  1. Enter the project's output folder and check out the results.

License

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.

Authors

About

Welcome to the repository for the mathematical models and code associated with the research paper 'A New Modelling Framework for Predator-Prey Interactions: A Case Study of an Aphid-Ladybeetle System' published in Ecological Informatics in 2023. This repository provides the source code and data used in the study.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 97.4%
  • Python 2.6%