| fit_4pl | R Documentation |
The frequentist analogue of bayesTLS::fit_4pl(). Consumes standardize_data()
output and fits the single-stage 4PL thermal-load-sensitivity model, parameterised
directly in CTmax and thermal sensitivity (z), via the freqTLS TMB engine.
Returns a freq_tls workflow object; uncertainty (Wald / profile / bootstrap)
is computed on demand by the quantity analogues (tls(), confint()).
fit_4pl(
data,
ctmax = NULL,
z = NULL,
up = NULL,
low = NULL,
k = NULL,
by = NULL,
threshold = c("relative", "absolute"),
p = 0.5,
t_ref = NULL,
bounds = c(0, 1),
family = NULL,
method = c("profile", "wald", "bootstrap"),
start = NULL,
control = list(),
trace = FALSE,
quiet = FALSE,
...,
fixed_low = NULL,
fixed_up = NULL,
fix_asymptotes = NULL,
lower = NULL,
upper = NULL
)
data |
Output of |
ctmax, z, up, low, k, by |
Direct-mode formula interface; see
|
threshold |
|
p |
Survival level for the absolute threshold (default 0.5). |
t_ref |
Positive reference exposure time at which CTmax is reported,
in minutes. When |
bounds |
Finite ordered range for estimated asymptotes, contained in
|
family |
|
method |
Default interval method for downstream extraction
( |
start |
Initial values passed to the engine |
control |
A list containing optional |
trace |
Logical scalar; print optimiser progress. |
quiet |
Logical; suppress diagnostic messages and warnings from the
underlying fit when |
... |
Recognized bayesTLS-only fitting arguments are rejected with
guidance because freqTLS does not run Bayesian sampling. Use formulas for
random-intercept structure and |
fixed_low |
Optional exact value for the constant lower asymptote. It
must lie in |
fixed_up |
Optional exact value for the constant upper asymptote. It
must lie in |
fix_asymptotes |
Bayesian-style asymptote pinning. |
lower, upper |
Optional bayesTLS-compatible aliases for the lower and
upper endpoints of |
A freq_tls object: a list with $fit (the engine fit), $data,
$formula, and $meta (threshold, t_ref, bounds, temp_mean, response_type,
family, grouped, moderators, method).
Use freqTLS at your own risk. Results and APIs may be incorrect or change. Users are responsible for checking their data, design, model specification, convergence, identifiability, diagnostics, and interpretation. Important analyses should be independently refitted and cross-checked with bayesTLS (source repository). Agreement is a cross-check, not proof of correctness; shared data or model errors can make both packages agree.
Run check_tls() before interpreting the fit. It gives a concrete recovery
action for each data-adequacy warning; vignette("profile-likelihood")
explains open profiles and the fit-specific bootstrap / Wald fallback.
standardize_data(), make_4pl_formula(), fit_tls(), check_tls()
raw <- simulate_tls(family = "binomial", times = c(30, 60, 120, 240, 480),
CTmax = 36, z = 4, 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, method = "wald", quiet = TRUE
)
coef(fit)
fit_2pl <- fit_4pl(
dat, family = "binomial", t_ref = 60, fixed_low = 0, fixed_up = 1,
quiet = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.