predict_survival_curves: Predict the fitted survival surface with bootstrap confidence...

View source: R/predict_survival_curves.R

predict_survival_curvesR Documentation

Predict the fitted survival surface with bootstrap confidence bands

Description

The frequentist analogue of bayesTLS::predict_survival_curves(). Evaluates the fitted thermal-survival probability over a temperature-by-duration grid and adds parametric-bootstrap confidence bands. For random-effects fits the curves are population-level: random intercepts are integrated during bootstrap refits, but no fitted group BLUP (best linear unbiased predictor; see ranef()) is added to the reported curve.

Usage

predict_survival_curves(
  object,
  temps = NULL,
  durations = NULL,
  nboot = 500L,
  level = 0.95,
  seed = NULL,
  by = NULL
)

Arguments

object

A freq_tls fit from fit_4pl() (or a profile_tls fit).

temps

Temperatures to predict at (default: the observed assay temps).

durations

Exposure durations in minutes (default: 100 points log-spaced over the observed range). fit_4pl() standardizes duration to minutes, including data supplied in hours.

nboot

Number of bootstrap replicates for the bands (default 500). Bootstrap bands currently require shared fixed-effect shape formulas (low = up = log_k = ~ 1). For varying shapes, use predict() for the fitted surface; a design-aware bootstrap surface is not yet available.

level

Confidence level (default 0.95).

seed

Optional RNG seed.

by

Optional name for the grouping column.

Value

A freq_surv_curves object: ⁠$summary⁠ (a tibble of ⁠[<group>,] temp, duration, survival_lower, survival_median, survival_upper⁠) and ⁠$meta⁠.

See Also

fit_4pl(), predict_survival_surface(), tls()

Examples


raw <- simulate_tls(family = "binomial", CTmax = 36, z = 4,
                    times = c(30, 60, 120, 240, 480), tref = 60, seed = 1)
dat <- standardize_data(
  raw, temp = "temp", duration = "duration",
  n_total = "total", n_surv = "survived", duration_unit = "minutes"
)
fit <- fit_4pl(dat, family = "binomial", t_ref = 60, quiet = TRUE)
curves <- predict_survival_curves(
  fit, temps = c(34, 36), durations = c(60, 240), nboot = 10, seed = 1
)
curves$summary


freqTLS documentation built on Dec. 4, 2026, 5:11 p.m.