Title: | Fitting and Analysing Thermal Performance Curves |
---|---|
Description: | Helps to fit thermal performance curves (TPCs). 'rTPC' contains 26 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>. |
Authors: | Daniel Padfield [aut, cre], Hannah O'Sullivan [aut], Francis Windram [aut] |
Maintainer: | Daniel Padfield <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.7 |
Built: | 2025-02-20 18:34:13 UTC |
Source: | https://github.com/padpadpadpad/rtpc |
Analytis-Kontodimas model for fitting thermal performance curves
analytiskontodimas_2004(temp, a, tmin, tmax)
analytiskontodimas_2004(temp, a, tmin, tmax)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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).
# 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()
# 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
ashrafi1_2018(temp, a, b, c)
ashrafi1_2018(temp, a, b, c)
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
# 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()
# 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
ashrafi2_2018(temp, a, b, c)
ashrafi2_2018(temp, a, b, c)
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
# 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()
# 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
ashrafi3_2018(temp, a, b, c)
ashrafi3_2018(temp, a, b, c)
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
# 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()
# 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
ashrafi4_2018(temp, a, b, c, d)
ashrafi4_2018(temp, a, b, c, d)
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
d |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
# 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()
# 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
ashrafi5_2018(temp, a, b, c, d)
ashrafi5_2018(temp, a, b, c, d)
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
d |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
Ashrafi, R. et al. Broad thermal tolerance is negatively correlated with virulence in an opportunistic bacterial pathogen. Evolutionary Applications 11, 1700–1714 (2018).
# 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()
# 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
atkin_2005(temp, r0, a, b)
atkin_2005(temp, r0, a, b)
temp |
temperature in degrees centigrade |
r0 |
scaling parameter, the minimum trait value |
a |
arbitrary scaling parameter |
b |
arbitrary scaling parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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.
# 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()
# 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()
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.
data("bacteria_tpc")
data("bacteria_tpc")
A data frame with 649 rows and 7 variables:
whether the bacteria was grown with or without phage
the assay temperature at which the growth rate was measured (degrees centigrade)
estimated growth rate per hour
Daniel Padfield
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.
data("bacteria_tpc") library(ggplot2) ggplot(bacteria_tpc) + geom_point(aes(temp, rate, col = phage))
data("bacteria_tpc") library(ggplot2) ggplot(bacteria_tpc) + geom_point(aes(temp, rate, col = phage))
Beta model for fitting thermal performance curves
beta_2012(temp, a, b, c, d, e)
beta_2012(temp, a, b, c, d, e)
temp |
temperature in degrees centigrade |
a |
dimensionless parameter |
b |
dimensionless parameter |
c |
dimensionless parameter |
d |
dimensionless parameter |
e |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model difficult to fit.
Daniel Padfield
Niehaus, Amanda C., et al. Predicting the physiological performance of ectotherms in fluctuating thermal environments. Journal of Experimental Biology 215.4: 694-701 (2012)
# 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()
# 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
betatypesimplified_2008(temp, rho, alpha, beta)
betatypesimplified_2008(temp, rho, alpha, beta)
temp |
temperature in degrees centigrade |
rho |
dimensionless parameter |
alpha |
dimensionless parameter |
beta |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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).
# 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()
# 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
boatman_2017(temp, rmax, tmin, tmax, a, b)
boatman_2017(temp, rmax, tmin, tmax, a, b)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
briere1_1999(temp, tmin, tmax, a)
briere1_1999(temp, tmin, tmax, a)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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)
# 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()
# 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
briere1simplified_1999(temp, tmin, tmax, a)
briere1simplified_1999(temp, tmin, tmax, a)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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)
# 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()
# 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
briere2_1999(temp, tmin, tmax, a, b)
briere2_1999(temp, tmin, tmax, a, b)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
briere2simplified_1999(temp, tmin, tmax, a, b)
briere2simplified_1999(temp, tmin, tmax, a, b)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
briereextended_2021(temp, tmin, tmax, a, b, d)
briereextended_2021(temp, tmin, tmax, a, b, d)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Cruz-Loya, M. et al. Antibiotics shift the temperature response curve of Escherichia coli growth. mSystems 6, e00228–21 (2021).
# 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()
# 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
briereextendedsimplified_2021(temp, tmin, tmax, a, b, d)
briereextendedsimplified_2021(temp, tmin, tmax, a, b, d)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Cruz-Loya, M. et al. Antibiotics shift the temperature response curve of Escherichia coli growth. mSystems 6, e00228–21 (2021).
# 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()
# 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
calc_params(model, ...)
calc_params(model, ...)
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 |
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()
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
.
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.
data("chlorella_tpc")
data("chlorella_tpc")
A data frame with 649 rows and 7 variables:
a unique value for each separate curve
the growth temperature that the culture was maintained at before measurements were taken (degrees centigrade)
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)
whether the curve depicts respiration or gross photosynthesis
the assay temperature at which the metabolic rate was measured (degrees centigrade)
the metabolic rate measured (micro mol O2 micro gram C-1 hr-1)
Daniel Padfield
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.
data("chlorella_tpc") library(ggplot2) ggplot(chlorella_tpc) + geom_point(aes(temp, rate, col = process)) + facet_wrap(~ growth_temp + flux)
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
delong_2017(temp, c, eb, ef, tm, ehc)
delong_2017(temp, c, eb, ef, tm, ehc)
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) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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.
# 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()
# 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
deutsch_2008(temp, rmax, topt, ctmax, a)
deutsch_2008(temp, rmax, topt, ctmax, a)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
eubank_1973(temp, topt, a, b)
eubank_1973(temp, topt, a, b)
temp |
temperature in degrees centigrade |
topt |
optimum temperature (ºC) |
a |
scale parameter defining the height of the curve |
b |
shape parameter of the curve |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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).
# 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()
# 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
flextpc_2024(temp, tmin, tmax, rmax, alpha, beta)
flextpc_2024(temp, tmin, tmax, rmax, alpha, beta)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally this model requires larger iter values in nls_multstart to fit reliably.
Francis Windram
Cruz-Loya M, Mordecai EA, Savage VM. A flexible model for thermal performance curves. bioRxiv [Preprint]. 2024
# 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()
# 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
flinn_1991(temp, a, b, c)
flinn_1991(temp, a, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
gaussian_1987(temp, rmax, topt, a)
gaussian_1987(temp, rmax, topt, a)
temp |
temperature in degrees centigrade |
rmax |
maximum rate at optimum temperature |
topt |
optimum temperature (ºC) |
a |
related to the full curve width |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Lynch, M., Gabriel, W., Environmental tolerance. The American Naturalist. 129, 283–303. (1987)
# 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()
# 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
gaussianmodified_2006(temp, rmax, topt, a, b)
gaussianmodified_2006(temp, rmax, topt, a, b)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
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.
Angilletta Jr, M. J. (2006). Estimating and comparing thermal performance curves. Journal of Thermal Biology, 31(7), 541-545.
# 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()
# 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
get_breadth(model, level = 0.8)
get_breadth(model, level = 0.8)
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 |
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.
Numeric estimate of thermal performance breadth (in ºC)
Estimate the critical thermal maximum of a thermal performance curve
get_ctmax(model)
get_ctmax(model)
model |
nls model object that contains a model of a thermal performance curve |
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.
Numeric estimate of critical thermal maximum (ºC)
Estimate the critical thermal minimum of a thermal performance curve
get_ctmin(model)
get_ctmin(model)
model |
nls model object that contains a model of a thermal performance curve |
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.
Numeric estimate of critical thermal minimum (ºC)
Estimate the activation energy of a thermal performance curve
get_e(model)
get_e(model)
model |
nls model object that contains a model of a thermal performance curve |
Fits a modified-Boltzmann equation to all raw data below the optimum temperature (ºC; as estimated by get_topt
).
Numeric estimate of activation energy (eV)
Estimate the deactivation energy of a thermal performance curve
get_eh(model)
get_eh(model)
model |
nls model object that contains a model of a thermal performance curve |
Fits a modified-Boltzmann equation to all raw data beyond the optimum temperature (ºC; as estimated by get_topt
).
Numeric estimate of activation energy (eV)
Sets wide lower limits on parameter values for each TPC model
get_lower_lims(x, y, model_name)
get_lower_lims(x, y, model_name)
x |
vector of temperature values |
y |
vector of rate values |
model_name |
the name of the model being fitted |
Named list of lower limits given the data and model being fitted
Daniel Padfield
Francis Windram
Lists or searches the models available in rTPC
get_model_names(model, returnall = FALSE)
get_model_names(model, returnall = FALSE)
model |
Optional string (or vector of strings) representing model/s to search for. |
returnall |
Also return the names of deprecated functions |
character vector of thermal performance curves available in rTPC
Daniel Padfield
Francis Windram
get_model_names() get_model_names("briere")
get_model_names() get_model_names("briere")
Estimate the q10 value of a thermal performance curve
get_q10(model)
get_q10(model)
model |
nls model object that contains a model of a thermal performance curve |
Fits the q10 portion of rezende_2019
to all raw data below the optimum temperature (ºC; as estimated by get_topt
).
Numeric estimate of q10 value
Estimate maximum rate of a thermal performance curve
get_rmax(model)
get_rmax(model)
model |
nls model object that contains a model of a thermal performance curve |
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.
Numeric estimate of maximum rate
Estimates skewness of a thermal performance curve
get_skewness(model)
get_skewness(model)
model |
nls model object that contains a model of a thermal performance curve |
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.
Numeric estimate of skewness
Estimates sensible start values for fitting thermal performance curves
get_start_vals(x, y, model_name)
get_start_vals(x, y, model_name)
x |
vector of temperature values |
y |
vector of rate values |
model_name |
the name of the model being fitted |
Named list of start parameters given the data and model being fitted
Daniel Padfield
Francis Windram
Estimate thermal safety margin of a thermal performance curve
get_thermalsafetymargin(model)
get_thermalsafetymargin(model)
model |
nls model object that contains a model of a thermal performance curve |
Thermal safety margin is calculated as: CTmax - Topt. This is calculated using the functions get_ctmax
and get_topt
.
Numeric estimate of thermal safety margin (in ºC)
Estimate thermal tolerance of a thermal performance curve
get_thermaltolerance(model)
get_thermaltolerance(model)
model |
nls model object that contains a model of a thermal performance curve |
Thermal tolerance is calculated as: CTmax - CTmin. This is calculated using the functions get_ctmax
and get_ctmin
.
Thermal tolerance (in ºC)
Estimate optimum temperature of a thermal performance curve
get_topt(model)
get_topt(model)
model |
nls model object that contains a model of a thermal performance curve |
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.
Numeric estimate of optimum temperature (in ºC)
Sets wide upper limits on parameter values for each TPC model
get_upper_lims(x, y, model_name)
get_upper_lims(x, y, model_name)
x |
vector of temperature values |
y |
vector of rate values |
model_name |
the name of the model being fitted |
Named list of upper limits given the data and model being fitted
Daniel Padfield
Francis Windram
Hinshelwood model for fitting thermal performance curves
hinshelwood_1947(temp, a, e, b, eh)
hinshelwood_1947(temp, a, e, b, eh)
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) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model difficult to fit.
Hinshelwood C.N. The Chemical Kinetics of the Bacterial Cell. Oxford University Press. (1947)
# 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()
# 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
janisch1_1925(temp, m, a, topt)
janisch1_1925(temp, m, a, topt)
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) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
Janisch, E. Über die Temperaturabhängigkeit biologischer Vorgänge und ihre kurvenmäßige Analyse. Pflüger's Arch. Physiol. 209, 414–436 (1925).
# 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()
# 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
janisch2_1925(temp, m, a, b, topt)
janisch2_1925(temp, m, a, b, topt)
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) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
Janisch, E. Über die Temperaturabhängigkeit biologischer Vorgänge und ihre kurvenmäßige Analyse. Pflüger's Arch. Physiol. 209, 414–436 (1925).
# 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()
# 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
joehnk_2008(temp, rmax, topt, a, b, c)
joehnk_2008(temp, rmax, topt, a, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Joehnk, Klaus D., et al. Summer heatwaves promote blooms of harmful cyanobacteria. Global change biology 14.3: 495-512 (2008)
# 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()
# 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
johnsonlewin_1946(temp, r0, e, eh, topt)
johnsonlewin_1946(temp, r0, e, eh, topt)
temp |
temperature in degrees centigrade |
r0 |
scaling parameter |
e |
activation energy (eV) |
eh |
high temperature de-activation energy (eV) |
topt |
optimum temperature (ºC) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model difficult to fit.
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.
# 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()
# 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
kamykowski_1985(temp, tmin, tmax, a, b, c)
kamykowski_1985(temp, tmin, tmax, a, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Kamykowski, Daniel. A survey of protozoan laboratory temperature studies applied to marine dinoflagellate behaviour from a field perspective. Contributions in Marine Science. (1985).
# 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()
# 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
lactin2_1995(temp, a, b, tmax, delta_t)
lactin2_1995(temp, a, b, tmax, delta_t)
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) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
lobry_1991(temp, rmax, topt, tmin, tmax)
lobry_1991(temp, rmax, topt, tmin, tmax)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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.
# 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()
# 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
mitchell_2009(temp, topt, a, b)
mitchell_2009(temp, topt, a, b)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
Mitchell, W. A., & Angilletta Jr, M. J. (2009). Thermal games: frequency-dependent models of thermal adaptation. Functional Ecology, 510-520.
# 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()
# 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
oneill_1972(temp, rmax, ctmax, topt, q10)
oneill_1972(temp, rmax, ctmax, topt, q10)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
pawar_2018(temp, r_tref, e, eh, topt, tref)
pawar_2018(temp, r_tref, e, eh, topt, tref)
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 |
This model is a modified version of sharpeschoolhigh_1981
that explicitly models the optimum temperature.
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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),
# 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()
# 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
quadratic_2008(temp, a, b, c)
quadratic_2008(temp, a, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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()
Ratkowsky model for fitting thermal performance curves
ratkowsky_1983(temp, tmin, tmax, a, b)
ratkowsky_1983(temp, tmin, tmax, a, b)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
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)
# 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()
# 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
rezende_2019(temp, q10, a, b, c)
rezende_2019(temp, q10, a, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Rezende, Enrico L., and Francisco Bozinovic. Thermal performance across levels of biological organization. Philosophical Transactions of the Royal Society B 374.1778 (2019): 20180549.
# 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()
# 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
rosso_1993(temp, rmax, topt, tmin, tmax)
rosso_1993(temp, rmax, topt, tmin, tmax)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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)
# 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()
# 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
sharpeschoolfull_1981(temp, r_tref, e, el, tl, eh, th, tref)
sharpeschoolfull_1981(temp, r_tref, e, el, tl, eh, th, tref)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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)
# 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()
# 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
sharpeschoolhigh_1981(temp, r_tref, e, eh, th, tref)
sharpeschoolhigh_1981(temp, r_tref, e, eh, th, tref)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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)
# 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()
# 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
sharpeschoollow_1981(temp, r_tref, e, el, tl, tref)
sharpeschoollow_1981(temp, r_tref, e, el, tl, tref)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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)
# 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()
# 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
spain_1982(temp, a, b, c, r0)
spain_1982(temp, a, b, c, r0)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
BASIC Microcomputer Models in Biology. Addison-Wesley, Reading, MA. 1982
# 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()
# 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
stinner_1974(temp, rmax, topt, a, b)
stinner_1974(temp, rmax, topt, a, b)
temp |
temperature in degrees centigrade |
rmax |
the maximum rate |
topt |
optimum temperature (ºC) at which rates are maximal |
a |
dimensionless parameter |
b |
dimensionless parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Daniel Padfield
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.
# 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()
# 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
taylorsexton_1972(temp, rmax, tmin, topt)
taylorsexton_1972(temp, rmax, tmin, topt)
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) |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
Taylor, S. E. & Sexton, O. J. Some implications of leaf tearing in Musaceae. Ecology 53, 143–149 (1972).
# 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()
# 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
thomas_2012(temp, a, b, c, tref)
thomas_2012(temp, a, b, c, tref)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Thomas, Mridul K., et al. A global pattern of thermal adaptation in marine phytoplankton. Science 338.6110, 1085-1088 (2012)
# 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()
# 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
thomas_2017(temp, a, b, c, d, e)
thomas_2017(temp, a, b, c, d, e)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Thomas, Mridul K., et al. Temperature–nutrient interactions exacerbate sensitivity to warming in phytoplankton. Global change biology 23.8 (2017): 3269-3280.
# 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()
# 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
tomlinsonphillips_2015(temp, a, b, c)
tomlinsonphillips_2015(temp, a, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model somewhat difficult to fit.
Francis Windram
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).
# 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()
# 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
warrendreyer_2006(temp, rmax, topt, a)
warrendreyer_2006(temp, rmax, topt, a)
temp |
temperature in degrees centigrade |
rmax |
maximum performance/value of the trait |
topt |
temperature of max performance (ºC) |
a |
shape parameter |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Francis Windram
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).
# 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()
# 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
weibull_1995(temp, a, topt, b, c)
weibull_1995(temp, a, topt, b, c)
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 |
Equation:
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.
a numeric vector of rate values based on the temperatures and parameter values provided to the function
Generally we found this model easy to fit.
Angilletta Jr, Michael J. Estimating and comparing thermal performance curves. Journal of Thermal Biology 31.7 (2006): 541-545.
# 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()
# 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()