DOI: 10.5061/dryad.18931zcxw
title: Improving estimations of life history parameters of small animals in mesocosm experiments: A case study on mosquitoes

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.
description: For full details see our paper: "Improving estimations of
 life history parameters of small animals in mesocosm experiments: A case
 study on mosquitoes". https://doi.org/10.1111/2041-210X.13814 
description: 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:<br>-
 normal_model_plus_optimisation.py<br>-
 mixed_model_plus_optimisation.py<br>The normal version should run on
 a regular laptop. The mixed version will require a supercomputer or
 computing cluster.<br>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). <br>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.<br>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 <br>conditions for treatment 1 as the optimised values from
 the all-normal approach. The optimised probabilities
 for each approach are stored in:<br>-
 normal_probabilities.txt<br>- mixed_probabilities.txt
 To run the validation (based on experimental data)
 use:<br>- validation.py For the simulation
 analysis:<br>To generate input files:<br>-
 simulation_analysis_create_inputs.py<br>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).<br>All inputs and outputs for the simulation analysis are
 available in simulation_analysis_inputs_and_outputs.zip<br>To
 analyse the results use:<br>-
 simulation_analysis_analyse_results.py To make graphs
 of adult emergence, proportions of larvae and pupae, and survival and
 development probabilities use:<br>- make_plots.py
 Data for the main and validation experiments is stored
 in:<br>- main_data.csv<br>- validation_data.csv
 To save the predicted populations and optimised probabilities to
 a csv file use:<br>- write_outputs_normal.py<br>-
 write_outputs_mixed.py