Joint Bayesian 4PL Models for Thermal Load Sensitivity
Overview
Fits joint Bayesian four-parameter logistic (4PL) models to thermal-tolerance proportion data, extracts the classical thermal load sensitivity quantities (z, CTmax at 1 hour, T_crit) with full posterior uncertainty, and predicts heat-injury accumulation and survival under fluctuating temperature regimes with optional Sharpe-Schoolfield repair. Models are fitted with 'Stan' via the 'brms' package. Implements the framework described in Noble, Arnold, Nakagawa and Pottier (in preparation).
First release.
bayesTLS fits joint Bayesian four-parameter logistic (4PL) models to
thermal-tolerance data and derives the classical thermal death time / thermal
load sensitivity quantities from the posterior, so that every downstream
quantity carries full uncertainty and is mutually consistent within a draw.
Model fitting
standardize_data()maps a raw thermal-tolerance dataset (binomial counts or continuous proportions) onto the columns the model expects, and records the duration unit and centring used.fit_4pl()fits the joint 4PL withbrms, in either the *midpoint* parameterisation or the *direct* CTmax/z parameterisation (ctmax = ~ ..., z = ~ ...), with moderators allowed on any sub-parameter.
Show all changes in 1.0.0Hide the rest of the changes in 1.0.0
make_4pl_formula()andmake_4pl_priors()expose the underlyingbrmsformula and default priors for inspection or customisation.
Deriving thermal load sensitivity
tls()derivesz,CTmaxandT_critper moderator group from any fitted 4PL — including hand-writtenbrmsmodels — by evaluating the sub-parameters on a moderator x temperature grid withbrms::posterior_linpred().tls_z(),tls_ctmax()andtls_tcrit()return the individual quantities;derive_tdt_curve()andderive_tdt_landscape()give the TDT curve and landscape.
Prediction under fluctuating temperatures
predict_heat_injury()accumulates heat injury over an arbitrary temperature trace, with optional Sharpe-Schoolfield repair (repair_rate_schoolfield()).predict_survival_curves()propagates that injury to survival.make_temperature_scenarios()builds fluctuating-temperature scenarios.
Two-stage comparison
ts_stage1(),ts_stage2(),ts_curve()andts_ci()implement the conventional two-stage TDT workflow, for direct comparison against the joint model.
Plotting and diagnostics
plot_tdt_curve(),plot_tdt_landscape(),plot_heat_injury(),plot_survival_curves(),plot_temperature_scenarios()and friends, all on a sharedtheme_tdt().diagnose_tdt_fit()andbayes_R2_tls()for fit checking.
Data
Four publicly available example datasets spanning lethal and sub-lethal
endpoints: aphid_tdt, dsuzukii, snowgum_psii and zebrafish_o2.
From NEWS.md in the release
Install
Health
- OK13 OK2026-09-08
- ERROR12 OK, 1 ERROR2026-09-07
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-07-22
Documentation
- Help pages
- 63 (16 internal)includes a package overview page
- Examples that run
- 43%20 run in a plain check · 27 never run
- Exported functions with examples
- 100%
- Documented parameters
- 91%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 24
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Issues over time
Commits over time
8 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/daniel1noble/bayestls on 2026-10-18.
The R CMD check workflow runs on Linux
GitHub Pages site last deployed 2026-10-16
Show all practicesHide 1 practice
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-04-21Seen in the repository: CLAUDE.mdNamed in .Rbuildignore: .claude, CLAUDE.mdNamed in .gitignore: .claudePull request it wrote: opened by a project memberCommits: at least 16 crediting it in the message
- GitHub Copilotfirst seen 2026-07-18Pull request: opened by its own accountCommits: 2 by its own account
- Claude Opus 4.814 commits · Jun to Jul 2026
- Claude Opus 4.71 commit · May 2026
- Claude Sonnet 4.61 commit · May 2026
Dependencies
Code & Tests
Datasets
People & History
- 1.0.0Latest2026-07-21 · current release
- RR 4.6.0 released · 2026-04-24
Package metadata
- First published
- 2026-07-21
- Total releases
- 1 / 1 yrs
- License
- CC BY 4.0
- Additional repositories
- stan-dev.r-universe.dev
- Minimum R
- ≥ 4.1.0
- Bundled data
- 21 KB / 4 files
- Download size
- 248 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("bayesTLS")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-21, which the citation names so these numbers can be found later. More on citing and the projects behind them.