Published October 11, 2026 | Version 2.0.0

Comparative Variance Partition along the Slow-Fast Continuum

  • 1. ROR icon École Normale Supérieure de Lyon
  • 2. ROR icon Woods Hole Oceanographic Institution

Description

Code and data for: Elise J.-P., Fay R., Garnier J., Caswell H., Gaillard J.-M., Gamelon M., Aubry L. M., Jenouvrier S. Differential Contributions of Heterogeneity and Stochasticity to Individuals’ Life Histories along the Slow-fast Continuum. Ecology Letters (submitted).

Content. Python code and simulated data that reproduce all results of the article (Figures 2–3, Table 2). The code builds two-stage (juvenile, adult) matrix population models for six synthetic species spanning the slow-fast continuum (generation times 2–25 years), with fixed individual heterogeneity in the vital rates. Heterogeneity is introduced either as differences in individual quality or as individual trade-offs. For every population, the code computes the mean and variance of longevity and lifetime reproductive output with Markov chain methods. It partitions the variance into individual stochasticity (within-group variance) and fixed individual heterogeneity (between-group variance), and decomposes the latter among vital rates and their interactions.

Files.

    README.md: full documentation, including the description of every data file, column and unit.
    code.zip: Python scripts (main.py, plotresults_articlescript.py), functions and tests.
    data.zip: simulation results for the three heterogeneity scenarios (CSV and NumPy .npz formats).
    figures.zip: Figures 2 and 3 (PDF) and the values shown in them and in Table 2 (CSV).
    CITATION.cff, LICENSE, DATA_LICENSE.md.

How to reproduce. Unzip the three archives into the same folder, then run:
pip install -r requirements.txt, python main.py (simulations, about 17 min on 2 cores), and python plotresults_articlescript.py (figures and Table 2).
To reproduce the figures without re-running the simulations, code.zip and data.zip are enough. Requires Python ≥ 3.9 with numpy, scipy and matplotlib; no proprietary software is needed.

Versions. Version 2.0.0 is a Python translation of the original MATLAB code (v1.0.0, doi:10.5281/zenodo.21210108). It also fixes the root-finding step for one species. See “Changes from the MATLAB version” in the README.

Licences. Code: GNU GPL v3.0 or later. Data: CC BY 4.0.

Contact: Jean-Pierre Elise (jean-pierre.elise@ens-lyon.fr).

Files

code.zip

Files (404.5 MB)

Name Size
md5:9ed1cbf30edfa00c4020783a87897922
3.0 kB Download
md5:dcfacfc79c6b91eb42d01504d890d04c
53.7 kB Preview Download
md5:7db9242e543b2a95082e126ee41ace3a
396.5 MB Preview Download
md5:e60f49c1442085148027ce8aaaf07917
1.0 kB Preview Download
md5:b54e5bb69c29460ca5638c59c72a8982
7.8 MB Preview Download
md5:1ebbd3e34237af26da5dc08a4e440464
35.1 kB Download
md5:7e2584fa6fd46f565cc409d867d2d4c1
22.2 kB Preview Download

Additional details

Software

Repository URL
https://github.com/jp-elise/individual_heterogeneity_python
Programming language
Python
Development Status
Active