Published February 7, 2022 | Version v1
Software Open

Improving estimations of life history parameters of small animals in mesocosm experiments: A case study on mosquitoes

  • 1. Leiden University

Description

We used an experimental setup with 48 aquatic mesocosms, each with twenty first instar mosquito (Culex pipiens) larvae and under one of twelve treatments with varying temperatures and nutrient concentrations. We took daily subsamples of the aquatic life stages as well as counting the emerging adults. We developed a method to estimate the survival and development probabilities at each life stage, based on optimising a matrix population model. We used two different approaches, one calculating the difference between predictions and observations based on a normal distribution, and the other using a combination of a normal and a multinomial distribution. For each approach, the resulting optimisation problem had around 100 parameters, making conventional gradient descent ineffective with our limited number of data points. We solved this by computing the formal derivatives of our matrix model.

Notes

These files accompany the paper "Improving estimations of life history parameters of small animals in mesocosm experiments: A case study on mosquitoes".

The code provided enables replication of our results.

If you wish to apply this methodology to your own research project then this code should provide a good starting point.

To run our model and the optimisation, use one of the following:
- normal_model_plus_optimisation.py
- mixed_model_plus_optimisation.py
The normal version should run on a regular laptop. The mixed version will require a supercomputer or computing cluster.
The mixed version requires Python3.7 or later.

The mixed version uses initial conditions defined in a separate text tile (initial_contidions_for_mixed.txt). 
We originally used very basic initial conditions(x0 = [0.5 for i in range(0,96)]+[1,1,1,2]), but found that this gave a non-optimal result for treatment 1.
To fix this we ran the optimisation again, with initial conditions for treatments 2-12 as the optimised values we had just calculated, and the initial 
conditions for treatment 1 as the optimised values from the all-normal approach.

The optimised probabilities for each approach are stored in:
- normal_probabilities.txt
- mixed_probabilities.txt

To run the validation (based on experimental data) use:
- validation.py

For the simulation analysis:
To generate input files:
- simulation_analysis_create_inputs.py
To run the simulation anaysis, you can use the normal_model_plus_optimisation.py and mixed_model_plus_optimisation.py files, just change the name of the observations ('main_data.csv') file (be warned, this takes a LOT of computing resources when running for the mixed-distribution approach).
All inputs and outputs for the simulation analysis are available in simulation_analysis_inputs_and_outputs.zip
To analyse the results use:
- simulation_analysis_analyse_results.py

To make graphs of adult emergence, proportions of larvae and pupae, and survival and development probabilities use:
- make_plots.py

Data for the main and validation experiments is stored in:
- main_data.csv
- validation_data.csv

To save the predicted populations and optimised probabilities to a csv file use:
- write_outputs_normal.py
- write_outputs_mixed.py

Funding provided by: Nederlandse Organisatie voor Wetenschappelijk Onderzoek
Crossref Funder Registry ID: http://dx.doi.org/10.13039/501100003246
Award Number: NWA.1160.1S.210

Funding provided by: Nederlandse Organisatie voor Wetenschappelijk Onderzoek
Crossref Funder Registry ID: http://dx.doi.org/10.13039/501100003246
Award Number: 613.009.103

Files

initial_conditions_for_mixed.txt

Files (107.9 kB)

Name Size Download all
md5:1297499e15d77713cb669f9c64b2fa5c
1.5 kB Preview Download
md5:bc07b869a53a6f415ff052a70f54ddf5
16.2 kB Download
md5:59d8119f707872cd017ca65a79df2b8f
23.4 kB Download
md5:9b2eefe02527ed8f186bd0acc683aa21
1.4 kB Preview Download
md5:c87d83351a6e7ca7c396fac66bf625f1
12.8 kB Download
md5:6cb33f07d830cf099dc3bc0a3974af89
1.5 kB Preview Download
md5:c02b0a903c7fdafd6bcf41a581e098b2
1.7 kB Preview Download
md5:c29d2e703b0eaac3be7e4ff9afe39cff
12.1 kB Download
md5:e17713df3499d50c7c8bf12b52271c01
14.9 kB Download
md5:142208b46d140c1a582cbde1c9647f89
12.9 kB Download
md5:759c71998045096b4ccb18f04f8fe1fa
4.4 kB Download
md5:3e6e95318979e85359fe23a6f0d6b294
5.0 kB Download

Additional details

Related works

Is cited by
10.1111/2041-210x.13814 (DOI)
Is source of
10.5061/dryad.18931zcxw (DOI)