ReadMe Users can perform the analysis by running the R script (PDFE_analysis.R) after the installation of all package mentioned in the preamble, then running the Mathematica notebook (moments_predicted.nb) This folder contains: - 1 dataset with population sizes: population_dynamics.csv - 1 dataset with glycerol concentrations: data_cinetique.csv - 5 C++ scripts compiled and run with the R TMB package: * density_dependence_cst.cpp : compute the negative loglikelihood of the dynamics of lines maintained in constant environments. This script estimates the growth rates and carrying capacities (constant within but varying between treatment genetic background x constant salinity). * logistic_data_K_unkownS_normal_autocorr_all_genotype.cpp : compute the negative loglikelihood for population dynamics of lines under stochastic environment, assuming a normal autocorrelated distribution of the growth rate with parameters (mean, standard deviation and autocorrelation) that depend on the genetic background and the autocorrelation treatment * logistic_data_K_unkownS_gamma_rho_all_genotype.cpp : compute the negative loglikelihood for population dynamics of lines under stochastic environment, assuming a reverse gamma distribution of the growth rate with parameters (mean, standard deviation and autocorrelation) that depend on the genetic background and the autocorrelation treatment * logistic_data_K: compute the negative loglikelihood for population dynamics of lines under stochastic environment and estimate parameters for the bivariate tolerance curves (parameters depend on the genetic background) * logistic_data_K_univariate: compute the negative loglikelihood for population dynamics of lines under stochastic environment and estimate parameters for the univariate tolerance curves (parameters depend on the genetic background) - 1 R script: PDFE_analysis.R. Performs the population dynamics analysis. Read the data, performs the survival analysis, analyses salinity effect on growth rate and carrying capacity in the constant salinity lines, analyses r distribution and fit bivariate and univariate tolerance curves in the stochastic lines. Code used for the plots is also present jointly with the analysis of the moments of N and r (estimation by treatment + regression). - A Mathematica notebook: moments_predicted.nb: compute the predicted mean, variance, skewness and autocorrelation of the growth rate given the bivariate and univariate tolerance curve parameters and the distribution of salinity in the different autocorrelation regime. https://doi.org/10.5061/dryad.7d7wm37rc