| predict_heat_injury | R Documentation |
predict_heat_injury() is the deterministic, maximum-likelihood prediction
analogue of bayesTLS::predict_heat_injury(): given a fitted thermal-load-
sensitivity curve and a temperature time-series (a "trace"), it accumulates
thermal damage as a fraction of the lethal dose and reads survival back off the
fitted survival curve. It does not fit an injury or repair model – fitting injury /
repair dynamics remains a bayesTLS concern (the complementary boundary);
predict_heat_injury() only predicts injury from the already-fitted survival
curve. For a random-effects fit it uses the population curve and does not add
a fitted group BLUP (best linear unbiased predictor; see ranef()).
predict_heat_injury(
object,
trace,
group = NULL,
target_surv = NULL,
t_c = NULL,
repair = NULL,
irreversible = TRUE,
T_c = NULL,
trace_unit = NULL,
irreversible_mortality = NULL,
repair_pars = NULL
)
object |
A |
trace |
A data frame with numeric columns |
group |
Optional single group level (grouped fits only; required when the fit is grouped). |
target_surv |
Optional absolute survival threshold defining one lethal
dose: a single probability strictly between the fitted lower and upper
asymptotes. |
t_c |
Optional damage-cutoff temperature (degrees C): at or below it the
damage rate is zero. |
repair |
Optional named list of Sharpe-Schoolfield repair parameters (see
Details); |
irreversible |
Logical; if |
T_c, trace_unit, irreversible_mortality, repair_pars |
Compatibility
aliases for |
One lethal dose is the thermal load that drives survival to a target set by
target_surv. With the default target_surv = NULL the target is the
project-default relative threshold – the curve midpoint (low + up) / 2.
At temperature T the lethal time to the target is
LT(T) = tref * 10^((CTmax - T) / z - q / k), where q is the negative
inverse curve coordinate for the requested normalized survival fraction.
Thus q = 0 at the common midpoint, and the value matches derive_lt().
The instantaneous
damage rate is 1 / LT(T) (lethal doses per time unit). Cumulative dose is
accumulated by forward Euler over the trace, using the actual per-step time
increments:
D_j = \max\!\big(0,\; D_{j-1} + (\mathrm{dmg}(T_{j-1}) -
\mathrm{rep}_{j-1})\,\Delta t_j\big),\quad D_1 = 0,
where \Delta t_j = t_j - t_{j-1}. Survival is read back from the selected curve by
treating the accumulated dose as an equivalent log10-time:
survival(D) evaluates the selected mean curve at k * log10(D) - q, so
D = 1 (one lethal dose) reaches exactly target_surv – the relative midpoint
(low + up) / 2 by default, or an absolute survival threshold when
target_surv is supplied.
The trace time and the fit's duration / tref must share a time unit.
Supported fits use minutes, so trace_unit = NULL means that trace time is
already in minutes. Supply trace_unit to convert hours, seconds, or days to
minutes. With irreversible = TRUE (default)
survival is monotone non-increasing. A damage cutoff t_c (for example from
derive_tcrit()) sets the damage rate to zero at or below t_c.
low, up, and k formulas are evaluated at each trace temperature.
Bootstrap confidence envelopes currently require constant or cell-mean shape
designs.
This integrator is forward Euler (left-endpoint, per actual step), not the
single-dt scheme some implementations use; irregular traces are integrated
with their real increments.
If repair is supplied, a Sharpe-Schoolfield repair rate is subtracted each
step (scaled by the current survival fraction, so repair shrinks as the
population dies). The repair parameters are a user-supplied scenario layer:
they are not identified by the survival data the model was fitted to, so
predict_heat_injury() warns when they are used. repair is a named list with
r_ref, t_a, t_al, t_ah, t_l, t_h, t_ref, with the four reference
temperatures in Kelvin. The freqTLS repair list expresses r_ref per
fitted time unit. Compatibility repair_pars treats r_ref as doses per
hour and converts it to the fitted minute scale.
A data frame with columns time, temp, dose (cumulative, as a
fraction of the lethal dose), injury (dose * 100, percent), and
survival.
derive_lt() for the lethal time, derive_tcrit() for a damage
cutoff temperature.
d <- simulate_tls(family = "binomial", times = c(30, 60, 120, 240, 480),
CTmax = 36, z = 4, tref = 60, seed = 1)
fit <- fit_tls(d, y = survived, n = total, time = duration, temp = temp,
family = "binomial", tref = 60)
trace <- data.frame(time = seq(0, 2, by = 0.05),
temp = 34 + 6 * sin(seq(0, 2, by = 0.05)))
head(predict_heat_injury(fit, trace))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.