DOI: 10.5061/dryad.rxwdbrvfp
title: Data and code from: Predicting the fundamental thermal niche of ectotherms

description: Climate warming is predicted to increase mean temperatures and thermal
 extremes on a global scale. Because their body temperature depends on the
 environmental temperature, ectotherms bear the full brunt of climate
 warming. Predicting the impact of climate warming on ectotherm diversity
 and distributions requires a framework that can translate temperature
 effects on ectotherm life history traits into population- and
 community-level outcomes. Here we present a mechanistic theoretical
 framework that can predict the fundamental thermal niche and climate
 envelope of ectotherm species based on how temperature affects the
 underlying life history traits. The advantage of this framework is
 two-fold. First, it can translate temperature effects on the phenotypic
 traits of individual organisms to population-level patterns observed in
 nature. Second, it can predict thermal niches and climate envelopes based
 solely on trait response data and hence completely independently of any
 population-level information. We find that the temperature at which the
 intrinsic growth rate is maximized exceeds the temperature at which
 abundance is maximized under density-dependent growth. As a result, the
 temperature at which a species will increase the fastest when rare is
 lower than the temperature at which it will recover from a perturbation
 the fastest when abundant. We test model predictions using data from a
 native-invasive interaction to identify the temperatures at which the
 invader can most easily invade the native's habitat, and the native
 species is most likely to resist the invader. The framework is
 sufficiently mechanistic to yield reliable predictions for individual
 species, and sufficiently broad to apply across a range of ectothermic
 taxa. This ability to predict the thermal niche before a species
 encounters a new thermal environment is essential to mitigating some of
 the major effects of climate change on ectotherm populations around the
 globe.
description: Please see Sections 4.2.2 and 4.2.3 of the Simon and
 Amarasekare<em> Ecology</em> paper for details on the
 experiments and parameter estimation approach used to collect and process
 this dataset.
description: ``` ## Description of the data and file structure ``` This repository
 includes the following files: Bagrada and harlequin data files containing
 the life history trait response data of the bagrada and harlequin bugs.
 These include the following files in csv format: 1\) **Bagrada-Amort**:
 columns are Temp.K (temperature in degrees Kelvin), Average.rate.per.day
 (average adult deaths per day), 95.CI.min (lower 95% confidence interval),
 95.CI.max (upper 95% confidence interval), SE (standard error) 2\)
 **Bagrada-Fec**: columns are Temp.K (temperature in degrees Kelvin),
 Average.rate.per.day (average eggs laid per female per day), 95.CI.min
 (lower 95% confidence interval), 95.CI.max (upper 95% confidence
 interval), SE (standard error) 3\) **Bagrada-Jmort**: columns are Temp.K
 (temperature in degrees Kelvin), Average.rate.per.day (average juvenile
 deaths per day), 95.CI.min (lower 95% confidence interval), 95.CI.max
 (upper 95% confidence interval), SE (standard error) 4\)
 **Bagrada-MatRate**: columns are Temp.K (temperature in degrees Kelvin),
 Average.rate.per.day (average of inverse of maturation time per individual
 juvenile; maturation time is the time it takes an individual to go from
 newly hatched to its emergence from its 5th instar (final) molt),
 95.CI.min (lower 95% confidence interval), 95.CI.max (upper 95% confidence
 interval), SE (standard error) 5\) **Harlequin-Amort**: columns are Temp.K
 (temperature in degrees Kelvin), Average.rate.per.day (average adult
 deaths per day), SE (standard error) 6\) **Harlequin-Fec**: columns are
 Temp.K (temperature in degrees Kelvin), Average.rate.per.day (average eggs
 laid per female per day), SE (standard error) 7\) **Harlequin-Jmort**:
 columns are Temp.K (temperature in degrees Kelvin), Average.rate.per.day
 (average juvenile deaths per day), SE (standard error) 8\)
 **Harlequin-MatRate**: columns are Temp.K (temperature in degrees Kelvin),
 Average.rate.per.day (average of inverse of maturation time per individual
 juvenile; maturation time is the time it takes an individual to go from
 newly hatched to its emergence from its 5th instar (final) molt), SE
 (standard error) 9\) **rFromMathematica-B-2023.csv**: bagrada intrinsic
 growth rate output generated from
 using life
 history traits given in above csv files (Bagrada-Amort, Bagrada-Fec,
 Bagrada-Jmort and Bagrada-MatRate). 10\) **rFromMathematica-H-2023.csv**:
 harlequin intrinsic growth rate output generated from
 using life
 history traits given in above csv files (Harlequin-Amort, Harlequin-Fec,
 Harlequin-Jmort and Harlequin-MatRate). These csv files can be opened and
 viewed in any text editor and can be read into R using
 'read.csv()'. ``` ## Code/Software ``` The following files used
 to analyze the data and generate figures are available on Zenodo. 1\)
 **IntrinsicGrowthRateCalculation_MathematicaCode.nb**: Mathematica code
 that outputs highly accurate intrinsic growth rate of harlequin and
 bagrada (see rFromMathematica-B-2023.csv and rFromMathematica-H-2023.csv).
 These growth rates were used in generation of Fig. 4. Mathematica was used
 for this because niche overlap was calculated in Mathematica, and there
 were very tiny differences between R and Mathematica predictions for
 bagrada and harlequin metrics likely stemming from differences in how the
 Lambert W function (referred to as a ProductLog in Mathematica) was
 calculated. We chose to plot Fig. 4 based on Mathematica's
 predictions because defining T_intersect, determined in Mathematica, is a
 key part of plotting this figure and niche overlap, presented on the
 figure, can only be calculated in Mathematica (see Fig. 4 section of
 ). 2\)
 **NicheOverlap_MathematicaCode.nb**: Mathematica file used to solve niche
 overlap Eq. (14) in the main text 3\)
 **NicheOverlap_MathematicaCode_OUTPUT.pdf**: pdf version of
 code and output for readers
 without access to Mathematica 4\) **ParameterEstimation_Rcode.Rmd**: R
 markdown file showing trait response parameterization from bagrada and
 harlequin data using nls() 5\) ParameterEstimation_Rcode_OUTPUT.pdf: pdf
 of Rmarkdown file output 6\)
 **Simulation_FigureGeneration_Rcode.R**: R file in which all DI simulation
 occurs, bagrada and harelquin metrics for Table 2 are calculated, and all
 main text and Appendix figures are generated