planted_dose_from_trace: Analytical heat-injury accumulation along a temperature trace

View source: R/temperature_scenarios.R

planted_dose_from_traceR Documentation

Analytical heat-injury accumulation along a temperature trace

Description

Implements the classical HI integral exactly (Equation 8 of the manuscript), given known TDT parameters. Use this as the truth that predict_heat_injury() should recover when fed the same trace and a model fit whose posterior is consistent with ⁠(z, CTmax_1hr, T_c)⁠.

Usage

planted_dose_from_trace(trace, z, CTmax_1hr, T_c)

Arguments

trace

Tibble with columns time and temp, output of make_temperature_scenarios().

z

Thermal sensitivity, °C per 10-fold change in time.

CTmax_1hr

Static temperature at which LT50 = 1 hour, °C.

T_c

Damage threshold (°C); contributions below T_c are zero.

Details

Integrated by forward Euler from zero: the interval ending at point i accrues the rate at its start (point i-1) times that interval's width,

\Delta HI_i = 100 \cdot 10^{(T_{i-1} - CT_{max,1hr}) / z} \cdot (t_i - t_{i-1})

when ⁠T_{i-1} > T_c⁠, and zero otherwise (and hi_inc[1] = 0). Cumulative HI is the running sum. This matches predict_heat_injury()'s integrator.

Value

The input trace augmented with two new columns: - hi_inc — instantaneous HI contribution at each hour (%). - hi_cumulative — running sum of hi_inc (%).

Examples

scens <- make_temperature_scenarios(spike_temp = 30)
planted_dose_from_trace(scens$single_spike, z = 5, CTmax_1hr = 32, T_c = 25)

bayesTLS documentation built on Nov. 29, 2026, 1:06 a.m.