| tls | R Documentation |
One call that derives the classical TDT quantities — thermal sensitivity
z, CTmax, and (for lethal endpoints) T_crit — per moderator group
from a fitted joint 4PL, including hand-written brms models with moderators
(sex, life stage, clone, ...) on any sub-parameter. The four sub-parameters
are evaluated at a moderator x temperature grid with
brms::posterior_linpred(), then z, CTmax and T_crit are derived from
the same posterior draws (so they are mutually consistent and T_crit pairs
CTmax and z per draw).
tls(
object,
by = NULL,
params = "all",
target_surv = "relative",
t_ref = NULL,
time_multiplier = NULL,
lethal = FALSE,
TC_rate_range = c(0.1, 1),
temp = "temp_c",
temp_mean = NULL,
temp_grid = NULL,
re_formula = NA,
lower = 0,
upper = 1,
nlpars = c("lowraw", "upraw", "logk", "mid"),
ndraws = NULL,
newdata = NULL,
probs = c(0.025, 0.5, 0.975),
seed = NULL,
mode = NULL,
p = NULL
)
tls_z(object, ...)
tls_ctmax(object, ...)
tls_tcrit(object, ...)
object |
A fitted |
by |
Character vector of moderator columns defining the groups reported
separately (e.g. |
params |
Quantities to return: |
target_surv |
Survival threshold the LT curve is read at:
|
t_ref |
Reference exposure duration for |
time_multiplier |
Multiplier from the model's time unit to minutes.
|
lethal |
Logical; with |
TC_rate_range |
Length-2 HI-rate floor range (% per hour) for T_crit. |
temp |
Name of the centred temperature column. Default |
temp_mean |
Centring constant mapping |
temp_grid |
Temperatures on the centred |
re_formula |
Passed to |
lower, upper |
Response bounds of the disjoint-bounds reparameterisation.
Read from a |
nlpars |
Non-linear parameter names, ordered low / up / k / mid (raw scale). |
ndraws |
Optional number of posterior draws to subsample: one subsample, shared by all four sub-parameters. A value at least the posterior size uses all draws. |
newdata |
Optional explicit moderator x temperature grid; overrides the
|
probs |
Summary quantiles (lower, median, upper). Default |
seed |
Optional integer seeding the draw subsample ( |
mode, p |
Deprecated, superseded by |
... |
Additional arguments passed on to |
tls() derives z, CTmax and T_crit from the same posterior draws, so
on a common temperature grid they are mutually consistent for every
threshold. z is the central-difference local z(T) (negative reciprocal of
the local slope of log10(LT) on temperature) pooled over temp_grid;
CTmax is the per-draw temperature at which the fitted LT curve crosses
t_ref: from the exact closed form whenever log10(LT) is a straight line
in temperature (checked on the evaluated curve, for every draw), and by
per-draw inversion of the bent curve otherwise. Under
target_surv = "relative" (the default) log10(LT) = mid(T) is linear for
midpoint and direct fits alike, so z is constant in temperature and
equals -1 / b_mid_temp_c, and CTmax is exact even far outside the data;
an absolute threshold is linear too when the asymptotes and steepness do
not change with temperature. With temperature effects on the asymptotes or
steepness, an absolute threshold bends the curve: the local z(T) follows
it, and CTmax is the curve's crossing of t_ref, interpolated linearly
between the points of the refined grid (see temp_grid). The crossing
taken is the one where the LT shortens
through t_ref as temperature rises; a draw with none, or more than one,
has no CTmax. Near an asymptote the LT at an absolute p can be
undefined at some temperatures (p outside the fitted asymptotes there);
it is then treated as zero (upper asymptote at or below p) or infinite
(lower asymptote at or above p), so a crossing next to such a
temperature is still found.
A tls object: $summary (per-group, per-quantity median + interval),
$draws (per-group, per-quantity posterior draws), and $meta.
## Not run:
tls(joint_sex_fit, by = "sex", lethal = TRUE, temp_mean = 36.1) # z, CTmax, T_crit per sex
tls(wf_leaf, params = "z") # z only, workflow
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.