Reversible phenotypic plasticity, the ability to change one’s phenotype repeatedly throughout life, can be selected for in environments that do not stay constant throughout an individual’s lifetime. It might also mitigate senescence, as the mismatch between the varying environment and a non-plastic individual’s traits is likely to increase as time passes. To understand why reversible plasticity may covary with lifespan, studies tend to assume unidirectional causality: plasticity evolves under suitable rates of environmental variation with respect to life history. Here we show that if lifespan also evolves in response to plasticity, then long life is not merely a context that sets the stage for lifelong plasticity. Instead, the causality is bidirectional because plasticity itself can select for longevity. Highly autocorrelated environmental fluctuations predict low investment in reversible plasticity and a phenotype that is poorly matched to the environment at older ages. Such environments select for high reproductive effort and short lifespans.
Simulation code for evolution of plasticity and reproductive investment
This is the main matlab code for a function that can be used to simulate the coevolution of reversible plasticity and reproductive investment. Please see paper for full explanation and justification of simulation. Requires ddist.m
evomemory.m
Matlab function to draw number of offspring
This is the function required to run evomemory.m simulation function. With this function you can sample n individuals from a discrete distribution given in p.
ddists.m
Matlab code to run the function evomemory.m for a range of parameters and save resulting data
This is the code for running the evomemory.m function to simulate data for a range of parameter values and save the data that has been generated.
lifeplast.m
R code to generate figures as presented in paper
This R code generates all the figures presented in Ratikainen&Kokko 2019 both for the main paper and the supplementary material. The code imports the data simulated with the matlab code lifeplast.m, evomemory.m and ddists.m. Make sure data files are in the same folder as R code file.
CodeForFigures.R
Simulated data illustrating the coevolution of lifespan and reversible plasticity
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for baseline parameter values. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplast.mat
Simulated data for coevolution of lifespan and reversible plasticity with low cost of plasticity
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for low costs of updating (kappa=0.2), baseline parameter values otherwise. These results are described in Supplementary note 1 and illustrated in Supplementary figure 4. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastCS02.mat
Simulated data for coevolution of lifespan and reversible plasticity with high cost of plasticity
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for high costs of updating (kappa=0.6), baseline parameter values otherwise. These results are described in Supplementary note 1 and illustrated in Supplementary figure 5. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastCS06.mat
Simulated data for coevolution of lifespan and reversible plasticity with high cost of reproduction
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for high costs of reproduction (rho=0.05), baseline parameter values otherwise. These results are described in Supplementary note 2 and illustrated in Supplementary figure 6. The code used to generate this data can be found here: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastCR005.mat
Simulated data for coevolution of lifespan and reversible plasticity when phenotypic mismatch affect only mortality
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where phenotypic mismatch with the environment affect only adult mortality but not reproductive success, baseline parameter values otherwise. These results are described in Supplementary note 3 and illustrated in Supplementary figure 7. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastMismatchAffectMortalityOnly.mat
Simulated data for coevolution of lifespan and reversible plasticity when phenotypic mismatch affect only fecundity
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where phenotypic mismatch with the environment affect only reproductive success but not adult mortality, baseline parameter values otherwise. These results are described in Supplementary note 4 and illustrated in Supplementary figure 8. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastMismatchAffectFecundityOnly.mat
Simulated data for coevolution of lifespan and reversible plasticity when environment varies according to ARMA model
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where the environment is simulated by an ARMA model (see supplementary note 5 for description), baseline parameter values otherwise. These results are described in Supplementary note 5 and illustrated in Supplementary figure 9. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastARMA.mat
Simulated data for coevolution of lifespan and reversible plasticity with ARMA modeled environment and low cost of plasticity
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where the environment is simulated by an ARMA model (see supplementary note 5 for description). In addition, cost of updating is lower than baseline (kappa=0.2) baseline parameter values otherwise. These results are described in Supplementary note 5 and illustrated in Supplementary figure 11. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastARMALowCost.mat
Simulated data for coevolution of lifespan and reversible plasticity with ARMA modeled environment and high cost of plasticity
This datafile contain the electronically simulated data generated by the model described in Ratikainen & Kokko 2019, for the case where the environment is simulated by an ARMA model (see supplementary note 5 for description). In addition, cost of updating is higher than baseline (kappa=0.6) baseline parameter values otherwise. These results are described in Supplementary note 5 and illustrated in Supplementary figure 10. The code used to generate this data is modified from: lifeplast.m, evomemory.m and ddists.m. Please see paper for full explanation and justification of the simulation model.
lifeplastARMAHighCost.mat