| derive_temperature_for_duration | R Documentation |
The vertical read of the survival surface: fix an exposure duration, find the temperature at which the posterior survival reaches the chosen threshold. Returns one temperature per posterior draw.
derive_temperature_for_duration(
workflow,
exposure_duration,
temp_grid = NULL,
target_surv = "relative",
ndraws = NULL,
probs = c(0.025, 0.5, 0.975),
seed = NULL,
by = NULL
)
workflow |
Fitted |
exposure_duration |
Numeric scalar — the fixed duration (model units). |
temp_grid |
Numeric vector of temperatures (°C) to search over
when the curve bends; it is extended beyond each end
by the data's temperature range (or its own width,
if wider; a single temperature is extended at a
fine step). Not needed for a straight curve, which
is solved exactly. |
target_surv |
Threshold mode. |
ndraws |
Posterior draws to use; |
probs |
Quantile probabilities. Default |
seed |
Optional integer seeding the draw subsample for
reproducibility. |
by |
Optional moderator column(s) for per-group results.
|
Threshold modes (via target_surv) match derive_tdt_curve():
"relative" (default) → temperature at which
mid(T) = log10(exposure_duration) per draw.
"absolute" (= 0.5) or numeric p in (0, 1) → temperature at which
the LT at the literal survival probability p (the midpoint plus the
model's closed-form offset) equals the exposure.
Each draw's temperature comes from the exact closed form whenever its
log10(LT) is a straight line in temperature: every relative threshold of
a fit whose midpoint is linear in temperature (midpoint and direct fits
alike), and an absolute threshold when the asymptotes and steepness do not
change with temperature. A curve that bends (temperature effects on the
asymptotes or steepness, under an absolute threshold) is inverted on
temp_grid, refined as in tls() (each interval split into equal steps of
at most 0.05 degrees C, but into no more than 20, so an interval wider than
1 degree C is refined to a twentieth of its width), by linear interpolation
between the refined points, taking the crossing
where the LT shortens through the exposure as temperature rises; draws that
do not cross on it are searched outward beyond each end, and draws left
without a single crossing are reported in a warning. Where an absolute
target lies outside the fitted asymptotes at a temperature, the LT there is
treated as zero or infinite, so a crossing next to it is still found.
tls() reads CTmax at t_ref the same way.
A list with draws (per-draw threshold temperatures; target_surv
column is a character label), summary (quantile summary),
exposure_duration, target_surv (the label), target_mode,
target_prob. A grouped fit adds the moderator column(s).
## Not run:
wf <- fit_4pl(std)
# Temperature giving the relative midpoint threshold after a 60-unit exposure:
tt <- derive_temperature_for_duration(wf, exposure_duration = 60,
temp_grid = seq(36, 44, by = 0.1))
tt$summary
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.