Package: rTFT 0.1.1

rTFT: Hazard Models for Thermal Failure Time Data

Fits discrete-time survival models to the times at which individual organisms fail under thermal exposure (e.g., loss of equilibrium, knockdown or death), using Bayesian inference in 'Stan' through 'brms'. The hazard is the product of a failure rate that depends on temperature, following Kingsolver and Umbanhowar (2018) <doi:10.1242/jeb.167858>, and a baseline that may depend on the time under exposure. Failure times may be known-time, interval-censored or both, and may come from static assays, ramping assays or both. The failure rate may depend on covariates, group-level effects and other stressors such as dissolved oxygen. Static and dynamic critical thermal maxima, thermal death time curves and thermal tolerance landscapes are derived from the fitted model with their posterior uncertainty. Models can be compared by cross-validation that leaves out whole individuals or trials, averaged, and used to predict survival along a record of temperature and of any co-stressors recorded with it.

Authors:Eduardo G. Martins [aut, cre]

rTFT_0.1.1.tar.gz
rTFT_0.1.1.zip(r-4.7-any)rTFT_0.1.1.zip(r-4.6-any)rTFT_0.1.1.zip(r-4.5-any)
rTFT_0.1.1.tgz(r-4.6-any)rTFT_0.1.1.tgz(r-4.5-any)
rTFT_0.1.1.tar.gz(r-4.7-any)rTFT_0.1.1.tar.gz(r-4.6-any)
rTFT_0.1.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
rTFT/json (API)

# Install 'rTFT' in R:
install.packages('rTFT', repos = c('https://eogmartins.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/eogmartins/rtft/issues

Pkgdown/docs site:https://eogmartins.github.io

Datasets:
  • ramp_assay - A simulated ramping assay of thermal tolerance, with two levels of oxygen
  • static_assay - A simulated static assay of thermal tolerance
  • stream_record - A simulated record of stream temperature

On CRAN:

Conda:

bayesianbrmsctmaxecologyecophysiologyhazard-modelstansurvival-analysistdtthermal-biologythermal-death-timethermal-ecologythermal-tolerancethermal-tolerance-landscapetime-to-event-analysisttlquarto

4.00 score 1 stars 6 scripts 40 exports 77 dependencies

Last updated from:e659624c8c (on v0.1.1). Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK229
source / vignettesOK301
linux-releaseOK230
macos-releaseOK266
macos-oldrelOK270
windows-develOK284
windows-releaseOK294
windows-oldrelOK369
wasm-releaseOK132

Exports:assess_ramp_linearityaverage_dctmaxaverage_survivalaverage_tdt_ttlbrms_log_h0brms_log_Mbuild_hazard_databuild_hazard_priorbuild_hazard_speccheck_survivalcloglog_bern_familycostressorderive_dctmaxderive_tdt_ttlfit_hazardh0_catalogueH0_ofH0inv_ofhazard_mixed_familyhazard_residualshazard_weightskfold_hazardlog_lik_cloglog_bernlog_lik_hazard_mixedloo_hazardM_catalogueM_drawsplot_checkplot_residualsplot_riskplot_survivalplot_tdtplot_ttlplot_ttl_3dposterior_epred_cloglog_bernposterior_epred_hazard_mixedposterior_predict_cloglog_bernposterior_predict_hazard_mixedpredict_survivalramp_path

Dependencies:abindbackportsbayesplotBHbridgesamplingbrmsBrobdingnagcallrcheckmateclicodacodetoolscpp11descdigestdistributionaldplyrfarverfuturefuture.applygenericsggdistggplot2ggridgesglobalsgluegridExtragtableinlineisobandlabelinglatticelifecyclelistenvloomagrittrMatrixmatrixStatsmgcvmvtnormnleqslvnlmenumDerivotelparallellypillarpkgbuildpkgconfigplyrposteriorprocessxpspurrrquadprogQuickJSRR6RColorBrewerRcppRcppEigenRcppParallelreshape2rlangrstanrstantoolsS7scalesStanHeadersstringistringrtensorAtibbletidyrtidyselectutf8vctrsviridisLitewithr

Comparing and averaging models
The candidate models | Cross-validation that leaves out whole trials | Model weights | Thermal tolerance averaged over the models | Survival along a record of stream temperature | Comparison with the model used to simulate the data | Reporting | Precomputed results | References

Last update: 2026-10-12
Started: 2026-10-09

Getting started with rTFT
The static assay | The table of intervals at risk | The model | Fitting | Convergence | Fit of the model to the data | Thermal tolerance derived from the fit | Parameters | Static critical thermal maximum | Dynamic critical thermal maximum | Thermal death time curves | Thermal tolerance landscape | Survival along a record of stream temperature | Extrapolations and assumptions behind the prediction | Predictions for warm periods | Comparison with the values used in the simulation | Further vignettes | Precomputed results | References

Last update: 2026-10-12
Started: 2026-10-07

Ramping assays
The ramping assay | The temperature of each ramp | Nominal ramps | Logged temperatures | The table of intervals at risk | Fitting | Convergence | Fit of the model to the data | Thermal tolerance derived from the fit | Parameters | Dynamic critical thermal maximum | Static critical thermal maximum and thermal death time curves | Thermal tolerance landscape | Comparison with the values used in the simulation | The choice of ramp rates | The span of the rates | Two assays of the same size | Temperatures and exposure times informed by a ramping assay | Recommendations | Precomputed results | References

Last update: 2026-10-12
Started: 2026-10-08

Temperature and a co-stressor
The assay | Dissolved oxygen as a co-stressor | The table of intervals at risk | Fitting | The effect of oxygen | Thermal tolerance at chosen levels of oxygen | Survival along a record of temperature and oxygen | Design of an assay with a co-stressor | Precomputed results | References

Last update: 2026-10-12
Started: 2026-10-10

Readme and manuals

Help Manual

Help pageTopics
Assess how linear a logged temperature trace isassess_ramp_linearity
Dynamic critical thermal maximum averaged over several fitted modelsaverage_dctmax
Survival along a record of temperature, averaged over several fitted modelsaverage_survival
Thermal tolerance averaged over several fitted modelsaverage_tdt_ttl
log h0(tau) for each baseline function, as a brms expression stringbrms_log_h0
log M(T) for each failure rate function, as a brms expression stringbrms_log_M
Build the row-per-interval table a failure-rate model is fitted tobuild_hazard_data
Weakly-informative default priors for a failure-rate hazard modelbuild_hazard_prior
Assemble the brms formula and family for a failure-rate hazard modelbuild_hazard_spec
Check a fitted model against the survival observed in each groupcheck_survival
Complementary log-log Bernoulli response, on the identity linkcloglog_bern_family
Declare a co-stressor for a failure-rate hazard modelcostressor
Dynamic critical thermal maximum under a ramp, from a fitted modelderive_dctmax
Thermal tolerance derived from a fitted failure-rate modelderive_tdt_ttl
Fit a failure-rate hazard model with brmsfit_hazard
Baseline hazard functions h0(tau)h0_catalogue
The cumulative baseline hazard of a given baseline functionH0_of
The inverse of the cumulative baseline hazardH0inv_of
Response distribution for a table mixing interval-censored and known-time failureshazard_mixed_family
Residuals of a fitted model, one per individualhazard_residuals
Weights for averaging failure-rate modelshazard_weights
Cross-validation by refitting, leaving out whole individuals or groupskfold_hazard
Leave-one-out cross-validation that leaves out whole individuals or groupsloo_hazard
Failure rate functions M(T)M_catalogue
The fitted failure rate over temperature, for each posterior drawM_draws
Plot the check of a fitted model against observed survivalplot_check
Plot the residuals of a fitted modelplot_residuals
Plot each period's share of the risk along a recordplot_risk
Plot survival along a record of temperatureplot_survival
Plot the thermal death time curvesplot_tdt
Plot the thermal tolerance landscapeplot_ttl
Plot the thermal tolerance landscape as a surface to rotateplot_ttl_3d
Survival along a record of temperature, from a fitted failure-rate modelpredict_survival
A simulated ramping assay of thermal tolerance, with two levels of oxygenramp_assay
Build a linear ramp temperature trajectoryramp_path
A simulated static assay of thermal tolerancestatic_assay
A simulated record of stream temperaturestream_record