1. ABOUT THE DATASET -------------------- Title: Dataset for 'Dynamics of fluctuating populations in multi-state switching environments' Creator(s): Mobilia, Mauro Organisation(s): Department of Applied Mathematics, School of Mathematics, University of Leeds, Leeds LS2 9JT, U.K. Rights-holder(s): Copyright 2026 University of Leeds Publication Year: 2026 Description: Dataset for 'Dynamics of fluctuating populations in multi-state switching environments'. The dataset contains the computational data from stochastic simulations, which are results presented as 2,3,5-10 of the paper. The dataset also contains the commented Python codes to generate the simulation data of Figures 2,3,5-10. A full description of the simulation data, methods, and interpretation may be found in the related publication (Section III and Appendix C). Cite as: Mobilia, Mauro (2026) Dataset for 'Dynamics of fluctuating populations in multi-state switching environments'. University of Leeds. [Dataset] https://doi.org/10.5518/1899. Related publication: Mobilia, M (2026) Dynamics of fluctuating populations in multi-state switching environments. To be submitted. Contact: M.Mobilia@leeds.ac.uk 2. TERMS OF USE --------------- Copyright 2026 University of Leeds. This dataset is licensed under a Creative Commons Attribution 4.0 International Licence: https://creativecommons.org/licenses/by/4.0/ 3. PROJECT AND FUNDING INFORMATION ---------------------------------- Title: DMS-EPSRC Eco-Evolutionary Dynamics of Fluctuating Populations Dates: 2021-2025 Funding organisation: EPSRC Grant no.: EP/V014439/1 Partial support from the U.K. Engineering and Physical Sciences Research Council (EPSRC) under the Grant No. EP/V014439/1 for the project ‘DMS-EPSRC Eco-Evolutionary Dynamics of Fluctuating Populations’ is gratefully acknowledged 4. CONTENTS ----------- File listing: The dataset contains a series of zip folders with simulation data and another series of zip folders with the simulation codes used to generate the data. ================ Simulation data ================ Simulation data are organised in zip folders called Data_Figures_2_and_9.zip, Data_Figure3.zip, Data_Figures_5-8_and_10.zip Each of them contain subfolders called Fig2A-Fig2H,..., Fig3A-Fig3D, ..., Fig5A-7A, ..., Fig5F-7F, Fig6A-8A, ..., Fig6F-8F, Fig10A, Fig10B. Each of these subfolders contain the csv files of the raw data for the set of parameters indicated in the file's name; see below. * Simulation data for Figures 2 and 9: -------------------------------------- Data_Figures_2_and_9.zip contains the subfolders Fig2A-Fig2H, Fig9A, Fig9B. Each of these subfolders contains csv files with raw data used to generate the corresponding figures. For example, the subfolder Fig2A contains the following csv files: Fig2A.pN_full_nu0.001_model_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv, Fig2A.p_PDMP_nu0.001_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv, Fig2A.pN_two_state_nu0.001_model_2states_Km50_Kp450_delta0.0_eps0.0_n1_R100000.csv. Fig2A.pN_full_nu0.001_model_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv contains the simulation data to generate the histogram of the full model ("pN") for the switching rate 0.001 (nu_3=0.001) when there are 3 environmental states and K^-=50, K^+=450, K_0=250; other parameters are delta=epsilon=0; see text. The other sub-folders and files of Data_Figures_2_and_9.zip are organised in the same way. *Simulation data for Figure 3: ------------------------------ Data_Figures3.zip contains the subfolders Fig3A-Fig3D. Each of these subfolders contains csv files with raw data used to generate the corresponding figures. For example, the subfolder Fig3A contains the following csv files: FIG3A.meanN_full-PDMP_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv, FIG3A.meanN_full-PDMP_3states_Km50_K0250_Kp450_delta0.2_eps0.0_R100000.csv, FIG3A.meanN_full-PDMP_3states_Km50_K0250_Kp450_delta-0.2_eps0.0_R100000.csv. Each of these files consists of 3 columns, giving the switching rate (nu), the average population size of the model (N_full), and the PDMP approximation of the average population size (N_PDMP): FIG3A.meanN_full-PDMP_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv contains the raw data of the average population size obtained from full stochastic simulations (N_full) and the N-PDMP approximation (N_PDMP) of the 3-state model with K^-=50, K^+=450, K_0=250; other parameters are delta=epsilon=0; see text. The other sub-folders and files of Data_Figures3.zip are organised in the same way. *Simulation data for Figures 5, 7 and 10: ----------------------------------------- Data_Figures_5-8_and_10.zip contains: the subfolders Fig5A-7A - Fig5F-7F, Fig8A-8A - Fig6F-8F, Fig10A, and Fig10B. Each of these subfolders contains csv files with raw data used to generate the corresponding figures. For example, the subfolder Fig5A contains the following csv files: FIG5A-7A.nu_sweep_with_errors_fixation_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv, FIG5A-7A.2states_updated_nutilde_sweep_with_errors_fixation_n1_Km50_Kp450_delta0.0_eps0.0_R100000.csv, FIG5A-7A.PDMP_fixation_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv, FIG5A-7A.PDMP_theory_limits_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv. FIG5A-7A.nu_sweep_with_errors_fixation_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv consists of one column giving the switching rate (nu), one column giving the S fixation probability (p_fix_A), one column giving the unconditional mean fixation time (mean_fix_time), one column for the statistical errors on the fixation probability (err_p_fix_A) and another one for the statistical errors on the fixation time (err_mean_fix_time). Data for p_fix_A are used for the Figure 5(a) and those for mean_fix_time are used for Fig.7(a). The results in this file have been obtained for the 3-state model with K^-=50, K^+=450, K_0=250; other parameters are delta=epsilon=0; see text. FIG5A-7A.2states_updated_nutilde_sweep_with_errors_fixation_n1_Km50_Kp450_delta0.0_eps0.0_R100000.csv consists of one column giving the effective switching rate (nu_tilde) and another one giving the switching rate (nu), one column giving the S fixation probability (p_fix_A), one column giving the unconditional mean fixation time (MFT), one column for the statistical errors on the fixation probability (err_p_fix_A) and another one for the statistical errors on the fixation time (err_mean_fix_time). Data for p_fix_A are used for the Figure 5(a) and those for mean_fix_time are used for Fig.7(a). The results in this file have been obtained for the 3-state model with K^-=50, K^+=450, K_0=250; other parameters are delta=epsilon=0; see text. FIG5A-7A.PDMP_fixation_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv consists of one column giving the switching rate (nu), another giving the rescaled switching rate (nu_rescaled), one column for the PDMP approximation of the fixation probability (phi_PDMP) and another one for the PDMP approximation of the unconditional mean fixation time (T_PDMP). Data for phi_PDMP are used for the Figure 5(a) and those for T_PDMP are used for Fig.7(a). The results in this file have been obtained for the 3-state model with K^-=50, K^+=450, K_0=250; other parameters are delta=epsilon=0; see text. FIG5A-7A.PDMP_theory_limits_3states_Km50_K0250_Kp450_delta0.0_eps0.0_R100000.csv contains the rescaling factor used in the PDMP approximation (scale_factor), the theoretical predictions for the fixation probability under slow switching (phi_0) and fast switching (phi_inf), as well as the theoretical predictions for the unconditional mean fixation time under slow switching (T_0) and fast switching (T_inf). It also contain the effective carrying capacity (K_eff). Data for phi_0 and phi_inf are used for the Figure 5(a) and those for T_0 and T_inf are used for Fig.7(a). The results in this file have been obtained for the 3-state model with K^-=50, K^+=450, K_0=250; other parameters are delta=epsilon=0; see text. The other sub-folders and files of Data_Figures_5-8_and_10.zip are organised in the same way. *Simulation data for Figures 6, 8 and 10 are organised and structured in the same way as the files for Figure 5 and 7. ============== Python codes ============== Simulation codes used to obtain the data for Figures 2,3,5-10 are organised in zip folders called Codes_Figures_2_and_9.zip, Code_Figure3.zip, and Codes_Figures_5-8_and_10.zip. Each of them contain commented python .py codes. Python codes to generate the data of Figures 2 and 9: ------------------------------------------------------ Pn_multistate_histograms.py and Pn_two-state_histograms.py. These codes generate the histograms of the population size for the multi-state and two-state models and a set of given switching rates by taking and binning R samples of length Delta_t (after discarding a transient t_burn) from a long trajectory generated from the Gillespie simulations. Parameters to be entered are: s, x_0, K_0, K^+, K^-, n, delta, epsilon, the set of switching rates to be considered, as well as the number of samples, the length Delta_t and t_burn. PDMP_histograms.py. This code generates the histograms of the PDMP approximation of the population size for a set of given switching rates by sampling and binning a long PDMP trajectory generated by combining Gillespie simulation for multi-state environmental switching and the logistic dynamics between successive switches. Parameters to be entered are: s, x_0, K_0, K^+, K^-, n, delta, epsilon, the set of switching rates to be considered, as well as the number of samples, the length Delta_t and t_burn. Python codes to generate the data of Figures 3: ----------------------------------------------- AvN_FULL-and-PDMP.py. This code computes the longtime average population size for the full individual-based model by taking R samples of length Delta_t (after discarding a transient t_burn) from a long trajectory generated from the Gillespie simulations for a broad range of values of the switching rate. It does the same to compute the PDMP approximation of the average population size by taking R samples of length Delta_t (after discarding a transient t_burn) from a long trajectory generated by combining Gillespie simulation for environmental switching and the logistic dynamics between successive switches. Parameters to be entered are: s, x_0, K_0, K^+, K^-, n, delta, epsilon, as well as the number of samples, the length Delta_t and t_burn. Python codes to generate the data of Figures 5, 6, 7, 8 and 10: --------------------------------------------------------------- Multistate_Fixation-sweep.py. This code performs stochastic simulations of the multi-state switching model and compute the S fixation probability ("p_fix_A" and unconditional mean fixation time ("mean_fix_time") by sampling R realisations for a broad range of values of the switching rate. Parameters to be entered are: s, x_0, K_0, K^+, K^-, n, delta, epsilon, as well as the number of realisations to be performed. Binary_Fixation-sweep.py. This code performs stochastic simulations for the effective two-state switching model and compute the S fixation probability ("p_fix_A") and unconditional mean fixation time ("MFT") by sampling R realisations. Parameters to be entered are: s, x_0, K^+, K^-, n, delta, epsilon, as well as the number of realisations to be performed. PDMP_Fixation-sweep.py. This code performs PDMP-based simulations of the effective binary switching model using the PDMP approximation for the dynamics of N. The script computed the PDMP-based approximation of the S fixation probability ("phi_PDMP") and unconditional mean fixation time ("T_PDMP") by sampling R realisations for a broad range of values of the switching rate. Parameters to be entered are: s, x_0, K_0, K^+, K^-, n, delta, epsilon, as well as the number of realisations to be performed. Fixation-sweep-errors_multistate.py and Fixation-sweep-errors_two-state.py. These are the scripts used for estimating the statistical errors on the S fixation probability and unconditional mean fixation time for the multi-state and two-state cases. These python codes and scripts generate the csv files commented above. To use the codes/scripts: - Download the folders to a folder on the computer. - Extract each .zip file into that folder. - Open a Python session from that folder and run the relevant .py file. 5. METHODS ---------- Full details of the methods are provided in Section III and Appendix C of Mobilia, M. (2026) Dynamics of Fluctuating Populations in Multi-State Switching Environments (to be submitted).