| Type: | Package |
| Title: | Fitting and Analysing Thermal Performance Curves |
| Version: | 1.1.0 |
| Maintainer: | Daniel Padfield <d.padfield@exeter.ac.uk> |
| Description: | Helps to fit thermal performance curves (TPCs). 'rTPC' contains 49 model formulations previously used to fit TPCs and has helper functions to set sensible start parameters, upper and lower parameter limits and estimate parameters useful in downstream analyses, such as cardinal temperatures, maximum rate and optimum temperature. See Padfield et al. (2021) <doi:10.1111/2041-210X.13585>. |
| License: | GPL (≥ 3) |
| URL: | https://github.com/padpadpadpad/rTPC, https://padpadpadpad.github.io/rTPC/ |
| BugReports: | https://github.com/padpadpadpad/rTPC/issues |
| Depends: | R (≥ 4.1) |
| Imports: | cli, glue, rlang, stats |
| Suggests: | boot, broom, car, carrier, dplyr, forcats, ggplot2, ggrepel, knitr, lubridate, minpack.lm, mirai, MuMIn, nls.multstart, nlstools, patchwork, progress, purrr, RColorBrewer, rmarkdown, stringr, testthat, tibble, tidyr, tidyverse |
| VignetteBuilder: | knitr |
| Encoding: | UTF-8 |
| LazyData: | true |
| RoxygenNote: | 7.3.3 |
| NeedsCompilation: | no |
| Packaged: | 2026-04-10 10:06:41 UTC; dp415 |
| Author: | Daniel Padfield [aut, cre], Hannah O'Sullivan [aut], Francis Windram [aut] |
| Repository: | CRAN |
| Date/Publication: | 2026-04-10 11:00:13 UTC |
Analytis-Kontodimas model for fitting thermal performance curves
Description
Analytis-Kontodimas model for fitting thermal performance curves
Usage
analytiskontodimas_2004(temp, a, tmin, tmax)
Arguments
temp |
temperature in degrees centigrade |
a |
scale parameter defining the height of the curve |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
Details
Equation:
rate = a \cdot \left(T - T_{\text{min}}\right)^2 \cdot \left(T_{\text{max}} - T\right)
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Kontodimas, D. C., Eliopoulos, P. A., Stathas, G. J. & Economou, L. P. Comparative temperature-dependent development of Nephus includens (Kirsch) and Nephus bisignatus (Boheman) (Coleoptera: Coccinellidae) preying on Planococcus citri (Risso) (Homoptera: Pseudococcidae): evaluation of a linear and various nonlinear models using specific criteria. Environ. Entomol. 33, 1–11 (2004).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'analytiskontodimas_2004')
# fit model
mod <- nls.multstart::nls_multstart(rate~analytiskontodimas_2004(temp = temp, a, tmin, tmax),
data = d,
iter = 200,
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'analytiskontodimas_2004'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'analytiskontodimas_2004'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Ashrafi I model for fitting thermal performance curves
Description
Ashrafi I model for fitting thermal performance curves
Usage
ashrafi1_2018(temp, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
Details
Equation:
rate=a + b \cdot temp^{2} + log(temp) + c \cdot temp^{3}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'ashrafi1_2018')
# fit model
mod <- nls.multstart::nls_multstart(rate~ashrafi1_2018(temp = temp, a, b, c),
data = d,
iter = c(4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'ashrafi1_2018'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'ashrafi2_2018'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Ashrafi II model for fitting thermal performance curves
Description
Ashrafi II model for fitting thermal performance curves
Usage
ashrafi2_2018(temp, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
Details
Equation:
rate=a + b \cdot temp^{\frac{3}{2}} + c \cdot temp^{2}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'ashrafi2_2018')
# fit model
mod <- nls.multstart::nls_multstart(rate~ashrafi2_2018(temp = temp, a, b, c),
data = d,
iter = c(4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'ashrafi2_2018'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'ashrafi2_2018'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Ashrafi III model for fitting thermal performance curves
Description
Ashrafi III model for fitting thermal performance curves
Usage
ashrafi3_2018(temp, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
Details
Equation:
rate = \frac{1}{(a + b \cdot exp^{temp} + d \cdot exp^{-temp})}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'ashrafi3_2018')
# fit model
mod <- nls.multstart::nls_multstart(rate~ashrafi3_2018(temp = temp, a, b, c),
data = d,
iter = c(4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'ashrafi3_2018'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'ashrafi3_2018'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Ashrafi IV model for fitting thermal performance curves
Description
Ashrafi IV model for fitting thermal performance curves
Usage
ashrafi4_2018(temp, a, b, c, d)
Arguments
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
d |
dimensionless parameter |
Details
Equation:
rate = a + b \cdot (temp + 273.15) + c \cdot log((temp + 273.15)^2) + \cdot \sqrt{temp + 273.15}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'ashrafi4_2018')
# fit model
mod <- nls.multstart::nls_multstart(rate~ashrafi4_2018(temp = temp, a, b, c, d),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'ashrafi4_2018'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'ashrafi4_2018'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Ashrafi V model for fitting thermal performance curves
Description
Ashrafi V model for fitting thermal performance curves
Usage
ashrafi5_2018(temp, a, b, c, d)
Arguments
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
d |
dimensionless parameter |
Details
Equation:
rate = a + b \cdot log(temp + 273.15)^2 + c \cdot log(temp + 273.15) + \frac{d \cdot log(temp + 273.15)}{temp + 273.15}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'ashrafi5_2018')
# fit model
mod <- nls.multstart::nls_multstart(rate~ashrafi5_2018(temp = temp, a, b, c, d),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'ashrafi5_2018'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'ashrafi5_2018'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Atkin model for fitting thermal performance curves
Description
Atkin model for fitting thermal performance curves
Usage
atkin_2005(temp, r0, a, b)
Arguments
temp |
temperature in degrees centigrade |
r0 |
scaling parameter, the minimum trait value |
a |
arbitrary scaling parameter |
b |
arbitrary scaling parameter |
Details
Equation:
rate = B_0 \cdot (a - b \cdot T)^{\frac{T}{10}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Atkin, OK, Bruhn D, Tjoelker MG. Response of Plant Respiration to Changes in Temperature: Mechanisms and Consequences of Variations in Q10 Values and Acclimation. In Plant Respiration. 2005.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'atkin_2005')
# fit model
mod <- nls.multstart::nls_multstart(rate~atkin_2005(temp = temp, r0, a, b),
data = d,
iter = 200,
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'atkin_2005'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'atkin_2005'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Example thermal performance curves of bacterial growth
Description
A dataset containing example data of growth rates of the bacteria Pseudomonas fluorescens in the presence and absence of its phage, phi2. Growth rates were measured across a range of assay temperatures to incorporate the entire thermal performance of the bacteria The dataset is the cleaned version so some data points have been omitted. There are multiple independent measurements per temperature for each treatment.
Usage
data("bacteria_tpc")
Format
A data frame with 649 rows and 7 variables:
- phage
whether the bacteria was grown with or without phage
- temp
the assay temperature at which the growth rate was measured (degrees centigrade)
- rate
estimated growth rate per hour
Source
Daniel Padfield
References
Padfield, D., Castledine, M., & Buckling, A. (2020). Temperature-dependent changes to host–parasite interactions alter the thermal performance of a bacterial host. The ISME Journal, 14(2), 389-398.
Examples
data("bacteria_tpc")
library(ggplot2)
ggplot(bacteria_tpc) +
geom_point(aes(temp, rate, col = phage))
Beta model for fitting thermal performance curves
Description
Beta model for fitting thermal performance curves
Usage
beta_2012(temp, a, b, c, d, e)
Arguments
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
d |
dimensionless parameter |
e |
dimensionless parameter |
Details
Equation:
rate=\frac{a\left(\frac{temp-b+\frac{c(d-1)}{d+e-2}}{c}\right)^{d-1} \cdot \left(1-\frac{temp-b+\frac{c(d-1)}{d+e-2}}{c}\right)^{e-1}}{{\left(\frac{d-1}{d+e-2}\right)}^{d-1}\cdot \left(\frac{e-1}{d+e-2}\right)^{e-1}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model difficult to fit.
Author(s)
Daniel Padfield
References
Niehaus, Amanda C., et al. Predicting the physiological performance of ectotherms in fluctuating thermal environments. Journal of Experimental Biology 215.4: 694-701 (2012)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'beta_2012')
# fit model
mod <- nls.multstart::nls_multstart(rate~beta_2012(temp = temp, a, b, c, d, e),
data = d,
iter = c(7,7,7,7,7),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'beta_2012'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'beta_2012'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Simplified Beta-type model for fitting thermal performance curves
Description
Simplified Beta-type model for fitting thermal performance curves
Usage
betatypesimplified_2008(temp, rho, alpha, beta)
Arguments
temp |
temperature in degrees centigrade |
rho |
dimensionless parameter |
alpha |
dimensionless parameter |
beta |
dimensionless parameter |
Details
Equation:
rate = \rho \cdot \left(a - \frac{T}{10}\right) \cdot \left(\frac{T}{10}\right)^b
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Damos, P. & Savopoulou-Soultani, M. Temperature-dependent bionomics and modeling of Anarsia lineatella (Lepidoptera: Gelechiidae) in the laboratory. J. Econ. Entomol. 101, 1557–1567 (2008).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'betatypesimplified_2008')
# fit model
mod <- nls.multstart::nls_multstart(rate~betatypesimplified_2008(temp = temp, rho, alpha, beta),
data = d,
iter = c(7,7,7),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'betatypesimplified_2008'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'betatypesimplified_2008'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Boatman model for fitting thermal performance curves
Description
Boatman model for fitting thermal performance curves
Usage
boatman_2017(temp, rmax, tmin, tmax, a, b)
Arguments
temp |
temperature in degrees centigrade |
rmax |
the rate at optimum temperature |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
shape parameter to adjust the skewness of the curve |
b |
shape parameter to adjust the kurtosis of the curve |
Details
Equation:
rate= r_{max} \cdot \left(sin\bigg(\pi\left(\frac{temp-t_{min}}{t_{max} - t_{min}}\right)^{a}\bigg)\right)^{b}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Boatman, T. G., Lawson, T., & Geider, R. J. A key marine diazotroph in a changing ocean: The interacting effects of temperature, CO2 and light on the growth of Trichodesmium erythraeum IMS101. PLoS ONE, 12, e0168796 (2017)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'boatman_2017')
# fit model
mod <- nls.multstart::nls_multstart(rate~boatman_2017(temp = temp, rmax, tmin, tmax, a, b),
data = d,
iter = c(4,4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'boatman_2017'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'boatman_2017'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Brière I model for fitting thermal performance curves
Description
Brière I model for fitting thermal performance curves
Usage
briere1_1999(temp, tmin, tmax, a)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
scale parameter to adjust maximum rate of the curve |
Details
Equation:
rate=a\cdot temp \cdot (temp - t_{min}) \cdot (t_{max} - temp)^{\frac{1}{2}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Brière, J.F., Pracros, P., Le Roux, A.Y., Pierre, J.S., A novel rate model of temperature-dependent development for arthropods. Environmental Entomololgy, 28, 22–29 (1999)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'briere1_1999')
# fit model
mod <- nls.multstart::nls_multstart(rate~briere1_1999(temp = temp, tmin, tmax, a),
data = d,
iter = c(3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'briere1_1999'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'briere1_1999'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Simplified Brière I model for fitting thermal performance curves
Description
Simplified Brière I model for fitting thermal performance curves
Usage
briere1simplified_1999(temp, tmin, tmax, a)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
scale parameter to adjust maximum rate of the curve |
Details
Equation:
rate=a \cdot (temp - t_{min}) \cdot (t_{max} - temp)^{\frac{1}{2}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Brière, J.F., Pracros, P., Le Roux, A.Y., Pierre, J.S., A novel rate model of temperature-dependent development for arthropods. Environmental Entomololgy, 28, 22–29 (1999)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'briere1simplified_1999')
# fit model
mod <- nls.multstart::nls_multstart(rate~briere1simplified_1999(temp = temp, tmin, tmax, a),
data = d,
iter = c(3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'briere1simplified_1999'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'briere1simplified_1999'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Brière II model for fitting thermal performance curves
Description
Brière II model for fitting thermal performance curves
Usage
briere2_1999(temp, tmin, tmax, a, b)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
scale parameter to adjust maximum rate of the curve |
b |
shape parameter to adjust the asymmetry of the curve |
Details
Equation:
rate=a\cdot temp \cdot(temp - t_{min}) \cdot (t_{max} - temp)^{\frac{1}{b}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Brière, J.F., Pracros, P., Le Roux, A.Y., Pierre, J.S., A novel rate model of temperature-dependent development for arthropods. Environmental Entomololgy, 28, 22–29 (1999)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'briere2_1999')
# fit model
mod <- nls.multstart::nls_multstart(rate~briere2_1999(temp = temp, tmin, tmax, a, b),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'briere2_1999'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'briere2_1999'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Simplified Brière II model for fitting thermal performance curves
Description
Simplified Brière II model for fitting thermal performance curves
Usage
briere2simplified_1999(temp, tmin, tmax, a, b)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
scale parameter to adjust maximum rate of the curve |
b |
shape parameter to adjust the asymmetry of the curve |
Details
Equation:
rate=a \cdot (temp - t_{min}) \cdot (t_{max} - temp)^{\frac{1}{b}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Brière, J.F., Pracros, P., Le Roux, A.Y., Pierre, J.S., A novel rate model of temperature-dependent development for arthropods. Environmental Entomololgy, 28, 22–29 (1999)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'briere2simplified_1999')
# fit model
mod <- nls.multstart::nls_multstart(rate~briere2simplified_1999(temp = temp, tmin, tmax, a, b),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'briere2simplified_1999'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'briere2simplified_1999'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Extended Brière model for fitting thermal performance curves
Description
Extended Brière model for fitting thermal performance curves
Usage
briereextended_2021(temp, tmin, tmax, a, b, d)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
scale parameter to adjust maximum rate of the curve |
b |
shape parameter to adjust the asymmetry of the curve |
d |
shape parameter to adjust the asymmetry of the curve |
Details
Equation:
rate=a \cdot temp \cdot (temp - t_{min})^b \cdot (t_{max} - temp)^d
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Cruz-Loya, M. et al. Antibiotics shift the temperature response curve of Escherichia coli growth. mSystems 6, e00228–21 (2021).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'briereextended_2021')
# fit model
mod <- nls.multstart::nls_multstart(rate~briereextended_2021(temp = temp, tmin, tmax, a, b, d),
data = d,
iter = c(4,4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'briereextended_2021'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'briereextended_2021'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Simplified Extended Brière model for fitting thermal performance curves
Description
Simplified Extended Brière model for fitting thermal performance curves
Usage
briereextendedsimplified_2021(temp, tmin, tmax, a, b, d)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
scale parameter to adjust maximum rate of the curve |
b |
shape parameter to adjust the asymmetry of the curve |
d |
shape parameter to adjust the asymmetry of the curve |
Details
Equation:
rate=a \cdot (temp - t_{min})^b \cdot (t_{max} - temp)^d
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Cruz-Loya, M. et al. Antibiotics shift the temperature response curve of Escherichia coli growth. mSystems 6, e00228–21 (2021).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'briereextendedsimplified_2021')
# fit model
mod <- nls.multstart::nls_multstart(
rate~briereextendedsimplified_2021(temp = temp, tmin, tmax, a, b, d),
data = d,
iter = c(4,4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'briereextendedsimplified_2021'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'briereextendedsimplified_2021'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Calculate extra parameters of a thermal performance curve
Description
Calculate extra parameters of a thermal performance curve
Usage
calc_params(model, ...)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
... |
additional arguments to pass to any of the functions used to estimate the traits. For example you can change the level argument of |
Details
Currently estimates:
maximum rate (rmax) using
get_rmax()optimum temperature (topt) using
get_topt()critical thermal maximum (ctmax) using
get_ctmax()critical thermal minimum (ctmin) using
get_ctmin()activation energy (e) using
get_e()deactivation energy (eh) using
get_eh()q10 value using
get_q10()thermal safety margin using
get_thermalsafetymargin()thermal tolerance using
get_thermaltolerance()thermal performance breadth using
get_breadth()skewness using
get_skewness()
Value
a dataframe containing the estimates of key TPC traits for a given model object. If any parameters cannot be calculated for a thermal performance curve, they will return NA.
Example metabolic thermal performance curves
Description
A dataset containing example data of rates of photosynthesis and respiration of the phytoplankton Chlorella vulgaris. Instantaneous rates of metabolism were made across a range of assay temperatures to incorporate the entire thermal performance of the populations. The dataset is the cleaned version so some datapoints have been omitted.
Usage
data("chlorella_tpc")
Format
A data frame with 649 rows and 7 variables:
- curve_id
a unique value for each separate curve
- growth_temp
the growth temperature that the culture was maintained at before measurements were taken (degrees centigrade)
- process
whether the cultures had been kept for a long time at their growth temperature (adaptation/~100 generations) or a short time (a measure of acclimation/~10 generations)
- flux
whether the curve depicts respiration or gross photosynthesis
- temp
the assay temperature at which the metabolic rate was measured (degrees centigrade)
- rate
the metabolic rate measured (micro mol O2 micro gram C-1 hr-1)
Source
Daniel Padfield
References
Padfield, D., Yvon-durocher, G., Buckling, A., Jennings, S. & Yvon-durocher, G. (2015). Rapid evolution of metabolic traits explains thermal adaptation in phytoplankton, Ecology Letters, 19, 133-142.
Examples
data("chlorella_tpc")
library(ggplot2)
ggplot(chlorella_tpc) +
geom_point(aes(temp, rate, col = process)) +
facet_wrap(~ growth_temp + flux)
DeLong enzyme-assisted Arrhenius model for fitting thermal performance curves
Description
DeLong enzyme-assisted Arrhenius model for fitting thermal performance curves
Usage
delong_2017(temp, c, eb, ef, tm, ehc)
Arguments
temp |
temperature in degrees centigrade |
c |
potential reaction rate |
eb |
baseline energy needed for the reaction to occur (eV) |
ef |
temperature dependence of folding the enzymes used in the metabolic reaction, relative to the melting temperature (eV) |
tm |
melting temperature in degrees centigrade |
ehc |
temperature dependence of the heat capacity between the folded and unfolded state of the enzymes, relative to the melting temperature (eV) |
Details
Equation:
rate = c \cdot exp\frac{-(e_b-(e_f(1-\frac{temp + 273.15}{t_m})+e_{hc} \cdot ((temp + 273.15) - t_m - (temp + 273.15) \cdot ln(\frac{temp + 273.15}{t_m}))))}{k \cdot (temp + 273.15)}
where k is Boltzmann's constant with a value of 8.62e-05 and tm is actually tm - 273.15
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
DeLong, John P., et al. The combined effects of reactant kinetics and enzyme stability explain the temperature dependence of metabolic rates. Ecology and evolution 7.11 (2017): 3940-3950.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'delong_2017')
# fit model
mod <- nls.multstart::nls_multstart(rate~delong_2017(temp = temp, c, eb, ef, tm,ehc),
data = d,
iter = c(4,4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'delong_2017'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'delong_2017'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Modified deutsch model for fitting thermal performance curves
Description
Modified deutsch model for fitting thermal performance curves
Usage
deutsch_2008(temp, rmax, topt, ctmax, a)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum rate at optimum temperature |
topt |
optimum temperature (ºC) |
ctmax |
critical thermal maximum (ºC) |
a |
related to the full curve width |
Details
Equation:
\textrm{if} \quad temp < t_{opt}: rate = r_{max} \cdot exp^{-\bigg(\frac{temp-t_{opt}}{2a}\bigg)^2}
\textrm{if} \quad temp > t_{opt}: rate = r_{max} \cdot \left(1 - \bigg(\frac{temp - t_{opt}}{t_{opt} - ct_{max}}\bigg)^2\right)
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Deutsch, C. A., Tewksbury, J. J., Huey, R. B., Sheldon, K. S., Ghalambor, C. K., Haak, D. C., & Martin, P. R. Impacts of climate warming on terrestrial ectotherms across latitude. Proceedings of the National Academy of Sciences, 105(18), 6668-6672. (2008)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'deutsch_2008')
# fit model
mod <- nls.multstart::nls_multstart(rate~deutsch_2008(temp = temp, rmax, topt, ctmax, a),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'deutsch_2008'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'deutsch_2008'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Eubank model for fitting thermal performance curves
Description
Eubank model for fitting thermal performance curves
Usage
eubank_1973(temp, topt, a, b)
Arguments
temp |
temperature in degrees centigrade |
topt |
optimum temperature (ºC) |
a |
scale parameter defining the height of the curve |
b |
shape parameter of the curve |
Details
Equation:
rate = \frac{a}{(T-T_{\text{opt}})^2+b}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Eubank, W. P., Atmar, J. W. & Ellington, J. J. The significance and thermodynamics of fluctuating versus static thermal environments on Heliothis zea egg development rates. Environ. Entomol. 2, 491–496 (1973).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'eubank_1973')
# fit model
mod <- nls.multstart::nls_multstart(rate~eubank_1973(temp = temp, topt, a, b),
data = d,
iter = 200,
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'eubank_1973'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'eubank_1973'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
flexTPC model for fitting thermal performance curves
Description
flexTPC model for fitting thermal performance curves
Usage
flextpc_2024(temp, tmin, tmax, rmax, alpha, beta)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
rmax |
maximum performance/value of the trait |
alpha |
shape parameter to adjust the asymmetry and direction of skew of the curve |
beta |
shape parameter to adjust the breadth of the curve |
Details
Equation:
rate=r_{\text{max}}\left[\left(\frac{T - T_{\text{min}}}{\alpha}\right)^\alpha\left(\frac{T_{\text{max}}-T}{1-\alpha}\right)^{1-\alpha}\left(\frac{1}{T_{\text{max}}-T_{\text{min}}}\right)\right]^{\frac{\alpha(1-\alpha)}{\beta^2}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally this model requires larger iter values in nls_multstart to fit reliably.
Author(s)
Francis Windram
References
Cruz-Loya M, Mordecai EA, Savage VM. A flexible model for thermal performance curves. bioRxiv [Preprint]. 2024
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'flextpc_2024')
# fit model
mod <- nls.multstart::nls_multstart(rate~flextpc_2024(temp = temp, tmin, tmax, rmax, alpha, beta),
data = d,
iter = c(5,5,5,5,5),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'flextpc_2024'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'flextpc_2024'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Flinn model for fitting thermal performance curves
Description
Flinn model for fitting thermal performance curves
Usage
flinn_1991(temp, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
parameter that controls the height of the curve |
b |
parameter that controls the slope of the initial increase of the curve |
c |
parameter that controls the position and steepness of the decline of the curve |
Details
Equation:
rate= \frac{1}{1+a+b \cdot temp+c \cdot temp^2}
Start values in get_start_vals are derived from previous methods from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Flinn PW Temperature-dependent functional response of the parasitoid Cephalonomia waterstoni (Gahan) (Hymenoptera, Bethylidae) attacking rusty grain beetle larvae (Coleoptera, Cucujidae). Environmental Entomology, 20, 872–876, (1991)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'flinn_1991')
# fit model
mod <- nls.multstart::nls_multstart(rate~flinn_1991(temp = temp, a, b, c),
data = d,
iter = c(4,4,4),
start_lower = start_vals - 1,
start_upper = start_vals + 1,
lower = get_lower_lims(d$temp, d$rate, model_name = 'flinn_1991'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'flinn_1991'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Gaussian model for fitting thermal performance curves
Description
Gaussian model for fitting thermal performance curves
Usage
gaussian_1987(temp, rmax, topt, a)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum rate at optimum temperature |
topt |
optimum temperature (ºC) |
a |
related to the full curve width |
Details
Equation:
rate = r_{max} \cdot exp^{\bigg(-0.5 \left(\frac{|temp-t_{opt}|}{a}\right)^2\bigg)}
Start values in get_start_vals are derived from the data
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Lynch, M., Gabriel, W., Environmental tolerance. The American Naturalist. 129, 283–303. (1987)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'gaussian_1987')
# fit model
mod <- nls.multstart::nls_multstart(rate~gaussian_1987(temp = temp,rmax, topt,a),
data = d,
iter = c(4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'gaussian_1987'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'gaussian_1987'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Modified gaussian model for fitting thermal performance curves
Description
Modified gaussian model for fitting thermal performance curves
Usage
gaussianmodified_2006(temp, rmax, topt, a, b)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum rate at optimum temperature |
topt |
optimum temperature |
a |
related to full curve width |
b |
allows for asymmetry in the curve fit |
Details
Equation:
rate = r_{max} \cdot \exp{\bigg[-0.5 \left(\frac{|temp-t_{opt}|}{a}\right)^b\bigg]}
Start values in get_start_vals are derived from the data and gaussian_1987
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model difficult to fit.
This function was previously called modifiedgaussian_2006() however this is now deprecated and will be removed in the future.
References
Angilletta Jr, M. J. (2006). Estimating and comparing thermal performance curves. Journal of Thermal Biology, 31(7), 541-545.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'gaussianmodified_2006')
# fit model
mod <- nls.multstart::nls_multstart(rate~gaussianmodified_2006(temp = temp, rmax, topt, a, b),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'gaussianmodified_2006'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'gaussianmodified_2006'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Estimate thermal performance breadth of a thermal performance curve
Description
Estimate thermal performance breadth of a thermal performance curve
Usage
get_breadth(model, level = 0.8)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
level |
proportion of maximum rate over which thermal performance breadth is calculated |
Details
Thermal performance breadth is calculated as the range of temperatures over which a curve's rate is at least 0.8 of peak. This defaults to a proportion of 0.8 but can be changed using the level argument.
Value
Numeric estimate of thermal performance breadth (in ºC)
Estimate the critical thermal maximum of a thermal performance curve
Description
Estimate the critical thermal maximum of a thermal performance curve
Usage
get_ctmax(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Critical thermal maximum is calculated by predicting over a temperature range 50 ºC beyond the maximum value in the dataset. The predicted rate value closest to 0 is then extracted. When this is impossible due to the curve formula (i.e the Sharpe-Schoolfield model), the temperature where the rate is 5 percent of the maximum rate is estimated. Predictions are done every 0.001 ºC so the estimate of the critical thermal maximum should be accurate up to 0.001 ºC.
Value
Numeric estimate of critical thermal maximum (ºC)
Estimate the critical thermal minimum of a thermal performance curve
Description
Estimate the critical thermal minimum of a thermal performance curve
Usage
get_ctmin(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Optimum temperature is calculated by predicting over a temperature range 50 degrees lower than the minimum value in the dataset. The predicted rate value closest to 0 is then extracted. When this is impossible due to the curve formula (i.e the Sharpe-Schoolfield model), the temperature where the rate is 5 percent of the maximum rate is estimated. Predictions are done every 0.001 ºC value so the estimate of the critical thermal minimum should be accurate up to 0.001 ºC.
Value
Numeric estimate of critical thermal minimum (ºC)
Estimate the activation energy of a thermal performance curve
Description
Estimate the activation energy of a thermal performance curve
Usage
get_e(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Fits a modified-Boltzmann equation to all raw data below the optimum temperature (ºC; as estimated by get_topt).
Value
Numeric estimate of activation energy (eV)
Estimate the deactivation energy of a thermal performance curve
Description
Estimate the deactivation energy of a thermal performance curve
Usage
get_eh(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Fits a modified-Boltzmann equation to all raw data beyond the optimum temperature (ºC; as estimated by get_topt).
Value
Numeric estimate of activation energy (eV)
Set broad lower limits on parameter values
Description
Sets wide lower limits on parameter values for each TPC model
Usage
get_lower_lims(x, y, model_name)
Arguments
x |
vector of temperature values |
y |
vector of rate values |
model_name |
the name of the model being fitted |
Value
Named list of lower limits given the data and model being fitted
Author(s)
Daniel Padfield
Francis Windram
Lists or searches the models available in rTPC
Description
Lists or searches the models available in rTPC
Usage
get_model_names(model, returnall = FALSE)
Arguments
model |
Optional string (or vector of strings) representing model/s to search for. |
returnall |
Also return the names of deprecated functions |
Value
character vector of thermal performance curves available in rTPC
Author(s)
Daniel Padfield
Francis Windram
Examples
get_model_names()
get_model_names("briere")
Estimate the q10 value of a thermal performance curve
Description
Estimate the q10 value of a thermal performance curve
Usage
get_q10(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Fits the q10 portion of rezende_2019 to all raw data below the optimum temperature (ºC; as estimated by get_topt).
Value
Numeric estimate of q10 value
Estimate maximum rate of a thermal performance curve
Description
Estimate maximum rate of a thermal performance curve
Usage
get_rmax(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Maximum rate is calculated by predicting over the temperature range using the previously estimated parameters and picking the maximum rate value. Predictions are done every 0.001 ºC.
Value
Numeric estimate of maximum rate
Estimates skewness of a thermal performance curve
Description
Estimates skewness of a thermal performance curve
Usage
get_skewness(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Skewness is calculated from the values of activation energy (e) and deactivation energy (eh) as: skewness = e - eh. A negative skewness indicates the TPC is left skewed, the drop after the optimum is steeper than the rise up to the optimum. A positive skewness means that the TPC is right skewed and a value of 0 would mean the curve is symmetrical around the optimum.
Value
Numeric estimate of skewness
Estimate start values for TPC fitting
Description
Estimates sensible start values for fitting thermal performance curves
Usage
get_start_vals(x, y, model_name)
Arguments
x |
vector of temperature values |
y |
vector of rate values |
model_name |
the name of the model being fitted |
Value
Named list of start parameters given the data and model being fitted
Author(s)
Daniel Padfield
Francis Windram
Estimate thermal safety margin of a thermal performance curve
Description
Estimate thermal safety margin of a thermal performance curve
Usage
get_thermalsafetymargin(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Thermal safety margin is calculated as: CTmax - Topt. This is calculated using the functions get_ctmax and get_topt.
Value
Numeric estimate of thermal safety margin (in ºC)
Estimate thermal tolerance of a thermal performance curve
Description
Estimate thermal tolerance of a thermal performance curve
Usage
get_thermaltolerance(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Thermal tolerance is calculated as: CTmax - CTmin. This is calculated using the functions get_ctmax and get_ctmin.
Value
Thermal tolerance (in ºC)
Estimate optimum temperature of a thermal performance curve
Description
Estimate optimum temperature of a thermal performance curve
Usage
get_topt(model)
Arguments
model |
nls model object that contains a model of a thermal performance curve |
Details
Optimum temperature (ºC) is calculated by predicting over the temperature range using the previously estimated parameters and keeping the temperature where the largest rate value occurs. Predictions are done every 0.001 ºC so the estimate of optimum temperature should be accurate up to 0.001 ºC.
Value
Numeric estimate of optimum temperature (in ºC)
Get a formula object for calling a TPC
Description
Get a formula object for calling a TPC
Usage
get_tpc_as_formula(model_name, temp, trait, explicit = FALSE)
Arguments
model_name |
the name of the model being fitted |
temp |
the name of the temperature column |
trait |
the name of the trait column |
explicit |
whether to return the formula constructed using the explicit form of the tpc function (e.g. |
Value
A formula calling the expected TPC
Author(s)
Francis Windram
Examples
get_tpc_as_formula("briere1_1999", "temperature", "rate")
# > rate ~ briere1_1999(temp = temperature, tmin, tmax, a)
Set broad upper limits on parameter values
Description
Sets wide upper limits on parameter values for each TPC model
Usage
get_upper_lims(x, y, model_name)
Arguments
x |
vector of temperature values |
y |
vector of rate values |
model_name |
the name of the model being fitted |
Value
Named list of upper limits given the data and model being fitted
Author(s)
Daniel Padfield
Francis Windram
Hinshelwood model for fitting thermal performance curves
Description
Hinshelwood model for fitting thermal performance curves
Usage
hinshelwood_1947(temp, a, e, b, eh)
Arguments
temp |
temperature in degrees centigrade |
a |
pre-exponential constant for the activation energy |
e |
activation energy (eV) |
b |
pre-exponential constant for the deactivation energy |
eh |
de-activation energy (eV) |
Details
Equation:
rate=a \cdot exp^{\frac{-e}{k \cdot (temp + 273.15)}} - b \cdot exp^\frac{-e_h}{k \cdot (temp + 273.15)}
where k is Boltzmann's constant with a value of 8.62e-05
Start values in get_start_vals are taken from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model difficult to fit.
References
Hinshelwood C.N. The Chemical Kinetics of the Bacterial Cell. Oxford University Press. (1947)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'hinshelwood_1947')
# fit model
mod <- nls.multstart::nls_multstart(rate~hinshelwood_1947(temp = temp,a, e, b, eh),
data = d,
iter = c(5,5,5,5),
start_lower = start_vals - 1,
start_upper = start_vals + 1,
lower = get_lower_lims(d$temp, d$rate, model_name = 'hinshelwood_1947'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'hinshelwood_1947'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Janisch I model for fitting thermal performance curves
Description
Janisch I model for fitting thermal performance curves
Usage
janisch1_1925(temp, m, a, topt)
Arguments
temp |
temperature in degrees centigrade |
m |
scale parameter (controlling the height of the curve) |
a |
shape parameter (controlling the shape of the curve) |
topt |
temperature of max performance (ºC) |
Details
Equation:
rate = \frac{1}{\frac{m}{2} \cdot \left[a^{T-T_{\text{opt}}}+a^{-(T-T_{\text{opt}})}\right]}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Janisch, E. Über die Temperaturabhängigkeit biologischer Vorgänge und ihre kurvenmäßige Analyse. Pflüger's Arch. Physiol. 209, 414–436 (1925).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'janisch1_1925')
# fit model
mod <- nls.multstart::nls_multstart(rate~janisch1_1925(temp = temp, m, a, topt),
data = d,
iter = 200,
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'janisch1_1925'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'janisch1_1925'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Janisch II model for fitting thermal performance curves
Description
Janisch II model for fitting thermal performance curves
Usage
janisch2_1925(temp, m, a, b, topt)
Arguments
temp |
temperature in degrees centigrade |
m |
scale parameter (controlling the height of the curve) |
a |
shape parameter (controlling the shape of the rising part of the curve) |
b |
shape parameter (controlling the shape of the falling part of the curve) |
topt |
temperature of max performance (ºC) |
Details
Equation:
rate = \frac{1}{\frac{m}{2} \cdot \left[a^{T-T_{\text{opt}}}+b^{-(T-T_{\text{opt}})}\right]}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Janisch, E. Über die Temperaturabhängigkeit biologischer Vorgänge und ihre kurvenmäßige Analyse. Pflüger's Arch. Physiol. 209, 414–436 (1925).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'janisch2_1925')
# fit model
mod <- nls.multstart::nls_multstart(rate~janisch2_1925(temp = temp, m, a, b, topt),
data = d,
iter = 200,
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'janisch2_1925'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'janisch2_1925'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Jöhnk model for fitting thermal performance curves
Description
Jöhnk model for fitting thermal performance curves
Usage
joehnk_2008(temp, rmax, topt, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
rmax |
the rate at optimum temperature |
topt |
optimum temperatute (ºC) |
a |
parameter with no biological meaning |
b |
parameter with no biological meaning |
c |
parameter with no biological meaning |
Details
Equation:
rate=r_{max} \bigg(1 + a \bigg(\bigg(b^{temp-t_{opt}} -1\bigg) - \frac{ln(b)}{ln(c)}(c^{temp-t_{opt}} -1)\bigg)\bigg)
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Joehnk, Klaus D., et al. Summer heatwaves promote blooms of harmful cyanobacteria. Global change biology 14.3: 495-512 (2008)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'joehnk_2008')
# fit model
mod <- nls.multstart::nls_multstart(rate~joehnk_2008(temp = temp, rmax, topt, a, b, c),
data = d,
iter = c(3,3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'joehnk_2008'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'joehnk_2008'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Johnson-Lewin model for fitting thermal performance curves
Description
Johnson-Lewin model for fitting thermal performance curves
Usage
johnsonlewin_1946(temp, r0, e, eh, topt)
Arguments
temp |
temperature in degrees centigrade |
r0 |
scaling parameter |
e |
activation energy (eV) |
eh |
high temperature de-activation energy (eV) |
topt |
optimum temperature (ºC) |
Details
Equation:
rate= \frac{r_0 \cdot exp^{\frac{-e}{k\cdot (temp + 273.15)}}}{1 + exp^{-\frac{e_h -\big(\frac{e_h}{(t_{opt} + 273.15)} + k \cdot ln\big(\frac{e}{e_h - e}\big) \big) \cdot (temp + 273.15)}{k \cdot (temp + 273.15)}}}
where k is Boltzmann's constant with a value of 8.62e-05.
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model difficult to fit.
References
Johnson, Frank H., and Isaac Lewin. The growth rate of E. coli in relation to temperature, quinine and coenzyme. Journal of Cellular and Comparative Physiology 28.1 (1946): 47-75.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'johnsonlewin_1946')
# fit model
mod <- suppressWarnings(
nls.multstart::nls_multstart(rate~johnsonlewin_1946(temp = temp, r0, e, eh, topt),
data = d,
iter = c(5,5,5,5),
start_lower = start_vals - 1,
start_upper = start_vals + 1,
lower = get_lower_lims(d$temp, d$rate, model_name = 'johnsonlewin_1946'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'johnsonlewin_1946'),
supp_errors = 'Y',
convergence_count = FALSE)
)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Kamykowski model for fitting thermal performance curves
Description
Kamykowski model for fitting thermal performance curves
Usage
kamykowski_1985(temp, tmin, tmax, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
parameter with no biological meaning |
b |
parameter with no biological meaning |
c |
parameter with no biological meaning |
Details
Equation:
rate= a \cdot \big( 1 - exp^{-b\cdot \big(temp-t_{min}\big)}\big) \cdot \big( 1-exp^{-c \cdot \big(t_{max}-temp\big)}\big)
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Kamykowski, Daniel. A survey of protozoan laboratory temperature studies applied to marine dinoflagellate behaviour from a field perspective. Contributions in Marine Science. (1985).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'kamykowski_1985')
# fit model
mod <- nls.multstart::nls_multstart(rate~kamykowski_1985(temp = temp, tmin, tmax, a, b, c),
data = d,
iter = c(3,3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'kamykowski_1985'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'kamykowski_1985'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Lactin2 model for fitting thermal performance curves
Description
Lactin2 model for fitting thermal performance curves
Usage
lactin2_1995(temp, a, b, tmax, delta_t)
Arguments
temp |
temperature in degrees centigrade |
a |
constant that determines the steepness of the rising portion of the curve |
b |
constant that determines the height of the overall curve |
tmax |
the temperature at which the curve begins to decelerate beyond the optimum (ºC) |
delta_t |
thermal safety margin (ºC) |
Details
Equation:
rate= = exp^{a \cdot temp} - exp^{a \cdot t_{max} - \bigg(\frac{t_{max} - temp}{\delta _{t}}\bigg)} + b
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Lactin, D.J., Holliday, N.J., Johnson, D.L. & Craigen, R. Improved rate models of temperature-dependent development by arthropods. Environmental Entomology 24, 69-75 (1995)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'lactin2_1995')
# fit model
mod <- nls.multstart::nls_multstart(rate~lactin2_1995(temp = temp, a, b, tmax, delta_t),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'lactin2_1995'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'lactin2_1995'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Lobry model for fitting thermal performance curves
Description
Lobry model for fitting thermal performance curves
Usage
lobry_1991(temp, rmax, topt, tmin, tmax)
Arguments
temp |
temperature in degrees centigrade |
rmax |
the maximum rate |
topt |
optimum temperature (ºC) at which rates are maximal |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
Details
Equation:
rate = rmax \cdot (1 - \frac{(temp - topt)^2)}{(temp - topt)^2 + temp \cdot (tmax + tmin - temp) - tmax \cdot tmin}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Lobry, J. R., Rosso, L., & Flandrois, J. P. (1991). A FORTRAN subroutine for the determination of parameter confidence limits in non-linear models. Binary, 3(86-93), 25.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'lobry_1991')
# fit model
mod <- nls.multstart::nls_multstart(rate~lobry_1991(temp = temp, rmax, topt, tmin, tmax),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'lobry_1991'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'lobry_1991'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Mitchell Angilletta model for fitting thermal performance curves
Description
Mitchell Angilletta model for fitting thermal performance curves
Usage
mitchell_2009(temp, topt, a, b)
Arguments
temp |
temperature in degrees centigrade |
topt |
optimum temperature (ºC) where rate is maximal |
a |
scale parameter to convert the value of the cosine density to the appropriate magnitude |
b |
parameter dictating the performance breadth |
Details
Equation:
rate=\frac{1}{2 \cdot b} \cdot (1 + cos(\frac{temp - t_{opt}}{b} \cdot \pi)) \cdot a
When temperatures fall below topt - b or above topt + b, rates are set to 0 to prevent multimodality.
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Mitchell, W. A., & Angilletta Jr, M. J. (2009). Thermal games: frequency-dependent models of thermal adaptation. Functional Ecology, 510-520.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'mitchell_2009')
# fit model
mod <- nls.multstart::nls_multstart(rate~mitchell_2009(temp = temp, topt, a, b),
data = d,
iter = c(3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'mitchell_2009'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'mitchell_2009'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
O'Neill model for fitting thermal performance curves
Description
O'Neill model for fitting thermal performance curves
Usage
oneill_1972(temp, rmax, ctmax, topt, q10)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum rate at optimum temperature |
ctmax |
high temperature (ºC) at which rates become negative |
topt |
optimum temperature (ºC) |
q10 |
defines the fold change in performance as a result of increasing the temperature by 10 ºC |
Details
Equation:
rate = r_{max} \cdot \bigg(\frac{ct_{max} - temp}{ct_{max} - t_{opt}}\bigg)^{x} \cdot exp^{x \cdot \frac{temp - t_{opt}}{ct_{max} - t_{opt}}}
where: x = \frac{w^{2}}{400}\cdot\bigg(1 + \sqrt{1 + \frac{40}{w}}\bigg)^{2}
and:\ w = (q_{10} - 1)\cdot (ct_{max} - t_{opt})
Start values in get_start_vals are derived from the data and previous values in the literature
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
O’Neill, R.V., Goldstein, R.A., Shugart, H.H., Mankin, J.B. Terrestrial Ecosystem Energy Model. Eastern Deciduous Forest Biome Memo Report Oak Ridge. The Environmental Sciences Division of the Oak Ridge National Laboratory. (1972)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'oneill_1972')
# fit model
mod <- nls.multstart::nls_multstart(rate~oneill_1972(temp = temp, rmax, ctmax, topt, q10),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'oneill_1972'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'oneill_1972'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Pawar model for fitting thermal performance curves
Description
Pawar model for fitting thermal performance curves
Usage
pawar_2018(temp, r_tref, e, eh, topt, tref)
Arguments
temp |
temperature in degrees centigrade |
r_tref |
rate at the standardised temperature, tref |
e |
activation energy (eV) |
eh |
high temperature de-activation energy (eV) |
topt |
optimum temperature (ºC) |
tref |
standardisation temperature in degrees centigrade. Temperature at which rates are not inactivated by high temperatures |
Details
This model is a modified version of sharpeschoolhigh_1981 that explicitly models the optimum temperature.
Equation:
rate= \frac{r_{tref} \cdot exp^{\frac{-e}{k} (\frac{1}{temp + 273.15}-\frac{1}{t_{ref} + 273.15})}}{1 + (\frac{e}{eh - e}) \cdot exp^{\frac{e_h}{k}(\frac{1}{t_opt + 273.15}-\frac{1}{temp + 273.15})}}
where k is Boltzmann's constant with a value of 8.62e-05.
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Kontopoulos, Dimitrios - Georgios, Bernardo García-Carreras, Sofía Sal, Thomas P. Smith, and Samraat Pawar. Use and Misuse of Temperature Normalisation in Meta-Analyses of Thermal Responses of Biological Traits. PeerJ. 6 (2018),
Examples
# load in ggplot
library(ggplot2)
library(nls.multstart)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'pawar_2018')
# fit model
mod <- nls_multstart(rate~pawar_2018(temp = temp, r_tref, e, eh, topt, tref = 20),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'pawar_2018'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'pawar_2018'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Quadratic model for fitting thermal performance curves
Description
Quadratic model for fitting thermal performance curves
Usage
quadratic_2008(temp, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
parameter that defines the rate at 0 ºC |
b |
parameter with no biological meaning |
c |
parameter with no biological meaning |
Details
Equation:
rate = a + b \cdot temp + c \cdot temp^2
Start values in get_start_vals are derived from the data using previous methods in the literature
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Montagnes, David JS, et al. Short‐term temperature change may impact freshwater carbon flux: a microbial perspective. Global Change Biology 14.12: 2823-2838. (2008)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'quadratic_2008')
# fit model
mod <- nls.multstart::nls_multstart(rate~quadratic_2008(temp = temp, a, b, c),
data = d,
iter = c(4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'quadratic_2008'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'quadratic_2008'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Perform a quick, automated, TPC fit
Description
Performs a simple TPC fit using nls_multstart. This function tries to use a sensible default configuration,
however if you want to use the more custom elements of nls_multstart then you will need to construct your own.
Usage
quickfit_tpc(data, model_name, temp, trait, start_adjusts = 0, iter, ...)
Arguments
data |
the data to fit a model to |
model_name |
the model name as a string |
temp |
the column name (as a string) containing the temperature data |
trait |
the column name (as a string) containing the temperature data |
start_adjusts |
any adjustments to make to the lower and upper starting bounds. If |
iter |
number of combinations of starting parameters which will be tried . If a single value is provided, then a shotgun/random-search/lhs approach will be used to sample starting parameters from a uniform distribution within the starting parameter bounds. If a vector of the same length as the number of parameters is provided, then a gridstart approach will be used to define each combination of that number of equally spaced intervals across each of the starting parameter bounds respectively. Thus, c(5,5,5) for three fitted parameters yields 125 model fits. Supplying a vector for iter will override convergence_count. |
... |
additional arguments to pass to |
Value
The nls model object of the fit model
Author(s)
Francis Windram
Examples
## Not run:
data("chlorella_tpc")
d <- subset(chlorella_tpc, curve_id == 1)
quickfit_tpc(
d,
"briere1_1999",
"temp",
"rate",
start_adjusts = 10,
iter = 150
)
quickfit_tpc(
d,
"briere1_1999",
"temp",
"rate",
start_adjusts = 0.8,
iter = c(5,5,5)
)
## End(Not run)
Perform an automated quick tpc fit across models and curves
Description
Performs a TPC fit using nls_multstart and map. This function tries to use a sensible default configuration,
however if you need to to use the more custom elements of nls_multstart then you will need to construct your own.
Usage
quickfit_tpc_multi(
data,
model_names,
temp,
trait,
start_adjusts = 0,
iter,
...
)
Arguments
data |
the data to fit a model to |
model_names |
a vector of model names to fit as strings |
temp |
the column name (as a string) containing the temperature data |
trait |
the column name (as a string) containing the temperature data |
start_adjusts |
any adjustments to make to the lower and upper starting bounds. If |
iter |
number of combinations of starting parameters which will be tried . If a single value is provided, then a shotgun/random-search/lhs approach will be used to sample starting parameters from a uniform distribution within the starting parameter bounds. If a vector of the same length as the number of parameters is provided, then a gridstart approach will be used to define each combination of that number of equally spaced intervals across each of the starting parameter bounds respectively. Thus, c(5,5,5) for three fitted parameters yields 125 model fits. Supplying a vector for iter will override convergence_count. |
... |
additional arguments to pass to |
Value
A tibble of model fits
Note
The parameters temp, trait, start_adjusts, iter, lhstype, gridstart, or force can be specified per-model
by providing a vector of values of a length equal to the number of models to be fit.
Author(s)
Francis Windram
Daniel Padfield
Examples
## Not run:
# load example data
data("chlorella_tpc")
# subset for just the first 5 curves
d <- subset(chlorella_tpc, curve_id <= 5)
quickfit_tpc_multi(d, c("briere1_1999", "briere2_1999"), "temp", "rate")
quickfit_tpc_multi(d, c("briere1_1999", "briere2_1999"), "temp", "rate", start_adjusts = 10)
quickfit_tpc_multi(d, c("briere1_1999", "briere2_1999"), "temp", "rate", iter = c(100, 150))
## End(Not run)
Ratkowsky model for fitting thermal performance curves
Description
Ratkowsky model for fitting thermal performance curves
Usage
ratkowsky_1983(temp, tmin, tmax, a, b)
Arguments
temp |
temperature in degrees centigrade |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
a |
parameter defined as sqrt(rate)/(temp - tmin) |
b |
empirical parameter needed to fit the data for temperatures beyond the optimum temperature |
Details
Equation:
rate = (a \cdot (temp-t_{min}))^2 \cdot (1-exp(b \cdot (temp-t_{max})))^2
Start values in get_start_vals are derived from the data and previous values in the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Ratkowsky, D.A., Lowry, R.K., McMeekin, T.A., Stokes, A.N., Chandler, R.E., Model for bacterial growth rate throughout the entire biokinetic temperature range. J. Bacteriol. 154: 1222–1226 (1983)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'ratkowsky_1983')
# fit model
mod <- nls.multstart::nls_multstart(rate~ratkowsky_1983(temp = temp, tmin, tmax, a, b),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'ratkowsky_1983'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'ratkowsky_1983'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Rezende model for fitting thermal performance curves
Description
Rezende model for fitting thermal performance curves
Usage
rezende_2019(temp, q10, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
q10 |
defines the fold change in performance as a result of increasing the temperature by 10 ºC |
a |
parameter describing shifts in rate |
b |
parameter threshold temperature (ºC) beyond which the downward curve starts |
c |
parameter controlling the rate of decline beyond the threshold temperature, b |
Details
Equation:
\textrm{if} \quad temp < b: rate = a \cdot 10 ^{\frac{\log_{10} (q_{10})}{(\frac{10}{temp})}}
\textrm{if} \quad temp > b: rate = a \cdot 10 ^{\frac{\log_{10} (q_{10})}{(\frac{10}{temp})}} \cdot \bigg(1-c \cdot (b-temp)^2 \bigg)
Start values in get_start_vals are derived from the data and previous values in the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Rezende, Enrico L., and Francisco Bozinovic. Thermal performance across levels of biological organization. Philosophical Transactions of the Royal Society B 374.1778 (2019): 20180549.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'rezende_2019')
# fit model
mod <- nls.multstart::nls_multstart(rate~rezende_2019(temp = temp, q10, a, b, c),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'rezende_2019'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'rezende_2019'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Rosso model for fitting thermal performance curves
Description
Rosso model for fitting thermal performance curves
Usage
rosso_1993(temp, rmax, topt, tmin, tmax)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum rate at optimum temperature |
topt |
optimum temperature (ºC) |
tmin |
low temperature (ºC) at which rates become negative |
tmax |
high temperature (ºC) at which rates become negative |
Details
Equation:
rate= rmax \cdot \frac{(temp - t_{max}) \cdot (temp - t_{min})^2}{(t_{opt} - t_{min}) \cdot ((t_{opt} - t_{min}) \cdot (temp - t_{opt}) - (t_{opt} - t_{max}) \cdot (t_{opt} + t_{min} - 2 \cdot temp))}
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Rosso, L., Lobry, J. R., & Flandrois, J. P. An unexpected correlation between cardinal temperatures of microbial growth highlighted by a new model. Journal of Theoretical Biology, 162(4), 447-463. (1993)
Examples
# load in ggplot
library(ggplot2)
library(nls.multstart)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'rosso_1993')
# fit model
mod <- nls_multstart(rate~lrf_1991(temp = temp, rmax, topt, tmin, tmax),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'rosso_1993'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'rosso_1993'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Full Sharpe-Schoolfield model for fitting thermal performance curves
Description
Full Sharpe-Schoolfield model for fitting thermal performance curves
Usage
sharpeschoolfull_1981(temp, r_tref, e, el, tl, eh, th, tref)
Arguments
temp |
temperature in degrees centigrade |
r_tref |
rate at the standardised temperature, tref |
e |
activation energy (eV) |
el |
low temperature de-activation energy (eV) |
tl |
temperature (ºC) at which enzyme is 1/2 active and 1/2 suppressed due to low temperatures |
eh |
high temperature de-activation energy (eV) |
th |
temperature (ºC) at which enzyme is 1/2 active and 1/2 suppressed due to high temperatures |
tref |
standardisation temperature in degrees centigrade. Temperature at which rates are not inactivated by either high or low temperatures |
Details
Equation:
rate= \frac{r_{tref} \cdot exp^{\frac{-e}{k} (\frac{1}{temp + 273.15}-\frac{1}{t_{ref} + 273.15})}}{1+ exp^{\frac{e_l}{k}(\frac{1}{t_l} - \frac{1}{temp + 273.15})} + exp^{\frac{e_h}{k}(\frac{1}{t_h}-\frac{1}{temp + 273.15})}}
where k is Boltzmann's constant with a value of 8.62e-05.
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Schoolfield, R. M., Sharpe, P. J. & Magnuson, C. E. Non-linear regression of biological temperature-dependent rate models based on absolute reaction-rate theory. Journal of Theoretical Biology 88, 719-731 (1981)
Examples
# load in ggplot
library(ggplot2)
library(nls.multstart)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'sharpeschoolfull_1981')
# fit model
mod <- nls_multstart(rate~sharpeschoolfull_1981(temp = temp, r_tref, e, el, tl, eh, th, tref = 20),
data = d,
iter = c(3,3,3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'sharpeschoolfull_1981'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'sharpeschoolfull_1981'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Sharpe-Schoolfield model (high temperature inactivation only) for fitting thermal performance curves
Description
Sharpe-Schoolfield model (high temperature inactivation only) for fitting thermal performance curves
Usage
sharpeschoolhigh_1981(temp, r_tref, e, eh, th, tref)
Arguments
temp |
temperature in degrees centigrade |
r_tref |
rate at the standardised temperature, tref |
e |
activation energy (eV) |
eh |
high temperature de-activation energy (eV) |
th |
temperature (ºC) at which enzyme is 1/2 active and 1/2 suppressed due to high temperatures |
tref |
standardisation temperature in degrees centigrade. Temperature at which rates are not inactivated by high temperatures |
Details
Equation:
rate= \frac{r_{tref} \cdot exp^{\frac{-e}{k} (\frac{1}{temp + 273.15}-\frac{1}{t_{ref} + 273.15})}}{1 + exp^{\frac{e_h}{k}(\frac{1}{t_h}-\frac{1}{temp + 273.15})}}
where k is Boltzmann's constant with a value of 8.62e-05.
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Schoolfield, R. M., Sharpe, P. J. & Magnuson, C. E. Non-linear regression of biological temperature-dependent rate models based on absolute reaction-rate theory. J. Theor. Biol. 88, 719-731 (1981)
Examples
# load in ggplot
library(ggplot2)
library(nls.multstart)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'sharpeschoolhigh_1981')
# fit model
mod <- nls_multstart(rate~sharpeschoolhigh_1981(temp = temp, r_tref, e, eh, th, tref = 20),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'sharpeschoolhigh_1981'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'sharpeschoolhigh_1981'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Sharpe-Schoolfield model (low temperature inactivation only) for fitting thermal performance curves
Description
Sharpe-Schoolfield model (low temperature inactivation only) for fitting thermal performance curves
Usage
sharpeschoollow_1981(temp, r_tref, e, el, tl, tref)
Arguments
temp |
temperature in degrees centigrade |
r_tref |
rate at the standardised temperature, tref |
e |
activation energy (eV) |
el |
low temperature de-activation energy (eV) |
tl |
temperature (ºC) at which enzyme is 1/2 active and 1/2 suppressed due to low temperatures |
tref |
standardisation temperature in degrees centigrade. Temperature at which rates are not inactivated by high temperatures |
Details
Equation:
rate= \frac{r_{tref} \cdot exp^{\frac{-e}{k} (\frac{1}{temp + 273.15}-\frac{1}{t_{ref} + 273.15})}}{1 + exp^{\frac{e_l}{k}(\frac{1}{t_l} - \frac{1}{temp + 273.15})}}
where k is Boltzmann's constant with a value of 8.62e-05.
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Schoolfield, R. M., Sharpe, P. J. & Magnuson, C. E. Non-linear regression of biological temperature-dependent rate models based on absolute reaction-rate theory. J. Theor. Biol. 88, 719-731 (1981)
Examples
# load in ggplot
library(ggplot2)
library(nls.multstart)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'sharpeschoollow_1981')
# fit model
mod <- nls_multstart(rate~sharpeschoollow_1981(temp = temp, r_tref, e, el, tl, tref = 20),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'sharpeschoollow_1981'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'sharpeschoollow_1981'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Spain model for fitting thermal performance curves
Description
Spain model for fitting thermal performance curves
Usage
spain_1982(temp, a, b, c, r0)
Arguments
temp |
temperature in degrees centigrade |
a |
constant that determines the steepness of the rising portion of the curve |
b |
constant that determines the position of topt |
c |
constant that determines the steepness of the decreasing part of the curve |
r0 |
the apparent rate at 0 ºC |
Details
Equation:
rate = r_0 \cdot exp^{a \cdot temp} \cdot (1-b \cdot exp^{c \cdot temp})
Start values in get_start_vals are derived from the data or plucked from thin air.
Limits in get_lower_lims and get_upper_lims are derived from the data or plucked from thin air.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
BASIC Microcomputer Models in Biology. Addison-Wesley, Reading, MA. 1982
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'spain_1982')
# fit model
mod <- nls.multstart::nls_multstart(rate~spain_1982(temp = temp, a, b, c, r0),
data = d,
iter = c(3,3,3,3),
start_lower = start_vals - 1,
start_upper = start_vals + 1,
lower = get_lower_lims(d$temp, d$rate, model_name = 'spain_1982'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'spain_1982'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Stinner model for fitting thermal performance curves
Description
Stinner model for fitting thermal performance curves
Usage
stinner_1974(temp, rmax, topt, a, b)
Arguments
temp |
temperature in degrees centigrade |
rmax |
the maximum rate |
topt |
optimum temperature (ºC) at which rates are maximal |
a |
dimensionless parameter |
b |
dimensionless parameter |
Details
Equation:
\textrm{if} \quad temp <= t_{opt}: rate = rmax \cdot \frac{1 + exp^{a + b \cdot t_{opt}}}{(1 + exp^{a + b \cdot temp}}
\textrm{if} \quad temp <= t_{opt}: rate = rmax \cdot \frac{1 + exp^{a + b \cdot t_{opt}}}{(1 + exp^{a + b \cdot (2 \cdot t_{opt} - temp)}}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Daniel Padfield
References
Stinner, R. E., Gutierrez, A. P., & Butler Jr, G. D. (1974). An algorithm for temperature-dependent growth rate simulation12. The Canadian Entomologist, 106(5), 519-524.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'stinner_1974')
# fit model
mod <- nls.multstart::nls_multstart(rate~stinner_1974(temp = temp, rmax, topt, a, b),
data = d,
iter = c(5,5,5,5),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'stinner_1974'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'stinner_1974'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Taylor-Sexton model for fitting thermal performance curves
Description
Taylor-Sexton model for fitting thermal performance curves
Usage
taylorsexton_1972(temp, rmax, tmin, topt)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum performance/value of the trait |
tmin |
low temperature (ºC) at which rates become negative |
topt |
optimum temperature (ºC) |
Details
Equation:
rate = R_{\text{max}} \cdot \frac{-(T-T_{\text{min}})^4 + 2 \cdot (T - T_{\text{min}})^2 \cdot (T_{\text{opt}}-T_{\text{min}})^2}{(T_{\text{opt}}-T_{\text{min}})^4}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Taylor, S. E. & Sexton, O. J. Some implications of leaf tearing in Musaceae. Ecology 53, 143–149 (1972).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'taylorsexton_1972')
# fit model
mod <- nls.multstart::nls_multstart(rate~taylorsexton_1972(temp = temp, rmax, tmin, topt),
data = d,
iter = 200,
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'taylorsexton_1972'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'taylorsexton_1972'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Thomas model (2012) for fitting thermal performance curves
Description
Thomas model (2012) for fitting thermal performance curves
Usage
thomas_2012(temp, a, b, c, tref)
Arguments
temp |
temperature in degrees centigrade |
a |
arbitrary constant |
b |
arbitrary constant |
c |
the range of temperatures over which growth rate is positive, or the thermal niche width (ºC) |
tref |
determines the location of the maximum of the quadratic portion of this function. When b = 0, tref would equal topt |
Details
Equation:
rate = a \cdot exp^{b \cdot temp} \bigg(1-\bigg(\frac{temp - t_{ref}}{c/2}\bigg)^2\bigg)
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Thomas, Mridul K., et al. A global pattern of thermal adaptation in marine phytoplankton. Science 338.6110, 1085-1088 (2012)
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'thomas_2012')
# fit model
mod <- nls.multstart::nls_multstart(rate~thomas_2012(temp = temp, a, b, c, tref),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 1,
start_upper = start_vals + 2,
lower = get_lower_lims(d$temp, d$rate, model_name = 'thomas_2012'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'thomas_2012'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Thomas model (2017) for fitting thermal performance curves
Description
Thomas model (2017) for fitting thermal performance curves
Usage
thomas_2017(temp, a, b, c, d, e)
Arguments
temp |
temperature in degrees centigrade |
a |
birth rate at 0 ºC |
b |
describes the exponential increase in birth rate with increasing temperature |
c |
temperature-independent mortality term |
d |
along with e controls the exponential increase in mortality rates with temperature |
e |
along with d controls the exponential increase in mortality rates with temperature |
Details
Equation:
rate = a \cdot exp^{b \cdot temp} - (c + d \cdot exp^{e \cdot temp})
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based on extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Thomas, Mridul K., et al. Temperature–nutrient interactions exacerbate sensitivity to warming in phytoplankton. Global change biology 23.8 (2017): 3269-3280.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'thomas_2017')
# fit model
mod <- nls.multstart::nls_multstart(rate~thomas_2017(temp = temp, a, b, c, d, e),
data = d,
iter = c(3,3,3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'thomas_2017'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'thomas_2017'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Tomlinson-Phillips model for fitting thermal performance curves
Description
Tomlinson-Phillips model for fitting thermal performance curves
Usage
tomlinsonphillips_2015(temp, a, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
parameter similar to R at Tmin |
b |
shape parameter indicating the slope of the upwards part of the curve |
c |
peak position parameter, similar to Topt |
Details
Equation:
rate = a \cdot [\exp{(b \cdot T) - \exp{(T-c)}}]
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model somewhat difficult to fit.
Author(s)
Francis Windram
References
Tomlinson, S. & Phillips, R. D. Differences in metabolic rate and evaporative water loss associated with sexual dimorphism in thynnine wasps. J. Insect Physiol. 78, 62–68 (2015).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'tomlinsonphillips_2015')
# fit model
mod <- nls.multstart::nls_multstart(rate~tomlinsonphillips_2015(temp = temp, a, b, c),
data = d,
iter = c(3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'tomlinsonphillips_2015'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'tomlinsonphillips_2015'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Warren-Dreyer model for fitting thermal performance curves
Description
Warren-Dreyer model for fitting thermal performance curves
Usage
warrendreyer_2006(temp, rmax, topt, a)
Arguments
temp |
temperature in degrees centigrade |
rmax |
maximum performance/value of the trait |
topt |
temperature of max performance (ºC) |
a |
shape parameter |
Details
Equation:
rate = R_{\text{max}} \cdot \exp{\left[-0.5 \cdot \left(\frac{\ln{\frac{T}{T_{\text{opt}}}}}{a}\right)^2\right]}
Start values in get_start_vals are derived from the data or sensible values from the literature.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
Author(s)
Francis Windram
References
Warren, C. R. & Dreyer, E. Temperature response of photosynthesis and internal conductance to CO2: results from two independent approaches. J. Exp. Bot. 57, 3057–3067 (2006).
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'warrendreyer_2006')
# fit model
mod <- nls.multstart::nls_multstart(rate~warrendreyer_2006(temp = temp, rmax, topt, a),
data = d,
iter = c(3,3,3),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'warrendreyer_2006'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'warrendreyer_2006'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()
Weibull model for fitting thermal performance curves
Description
Weibull model for fitting thermal performance curves
Usage
weibull_1995(temp, a, topt, b, c)
Arguments
temp |
temperature in degrees centigrade |
a |
scale the height of the curve |
topt |
optimum temperature |
b |
defines the breadth of the curve |
c |
defines the curve shape |
Details
Equation:
rate = a \cdot \bigg( \frac{c-1}{c}\bigg)^{\frac{1-c}{c}}\bigg(\frac{temp-t_{opt}}{b}+\bigg(\frac{c-1}{c}\bigg)^{\frac{1}{c}}\bigg)^{c-1}exp^{-\big(\frac{temp-t_{opt}}{b}+\big( \frac{c-1}{c}\big)^{\frac{1}{c}}\big)^c} + \frac{c-1}{c}
Start values in get_start_vals are derived from the data.
Limits in get_lower_lims and get_upper_lims are derived from the data or based extreme values that are unlikely to occur in ecological settings.
Value
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Note
Generally we found this model easy to fit.
References
Angilletta Jr, Michael J. Estimating and comparing thermal performance curves. Journal of Thermal Biology 31.7 (2006): 541-545.
Examples
# load in ggplot
library(ggplot2)
# subset for the first TPC curve
data('chlorella_tpc')
d <- subset(chlorella_tpc, curve_id == 1)
# get start values and fit model
start_vals <- get_start_vals(d$temp, d$rate, model_name = 'weibull_1995')
# fit model
mod <- nls.multstart::nls_multstart(rate~weibull_1995(temp = temp, a, topt, b, c),
data = d,
iter = c(4,4,4,4),
start_lower = start_vals - 10,
start_upper = start_vals + 10,
lower = get_lower_lims(d$temp, d$rate, model_name = 'weibull_1995'),
upper = get_upper_lims(d$temp, d$rate, model_name = 'weibull_1995'),
supp_errors = 'Y',
convergence_count = FALSE)
# look at model fit
summary(mod)
# get predictions
preds <- data.frame(temp = seq(min(d$temp), max(d$temp), length.out = 100))
preds <- broom::augment(mod, newdata = preds)
# plot
ggplot(preds) +
geom_point(aes(temp, rate), d) +
geom_line(aes(temp, .fitted), col = 'blue') +
theme_bw()