get_4pl_est: Posterior estimates of the natural-scale 4PL parameters...

View source: R/accessors.R

get_4pl_estR Documentation

Posterior estimates of the natural-scale 4PL parameters (draws or summary)

Description

The 4PL-shape companion to get_tls_est(). Returns the posterior of the natural-scale 4PL curve parameters from a fitted fit_4pl() workflow, as either per-draw values or a median + 95% credible-interval summary, per moderator group. Whereas get_tls_est() operates on a tls() object and returns the derived TLS quantities (z, CTmax, Tcrit), this operates on the fitted workflow and returns the raw curve parameters those quantities are derived from. A thin wrapper: "summary" calls tdt_parameter_table(), "draws" calls extract_4pl_pars().

Usage

get_4pl_est(workflow, what = c("summary", "draws"), by = NULL, temps = NULL)

Arguments

workflow

A fitted fit_4pl() workflow (workflow$fit not NULL).

what

"summary" (default; one row per parameter with median + 95% CrI at the centring temperature T_bar, via tdt_parameter_table() – this also includes the derived z slope row) or "draws" (per-draw natural- scale low, up, k, mid at each assay temperature, via extract_4pl_pars()).

by

Optional moderator column(s) to group by, passed through. NULL (default) uses the fit's own grouping for a grouped fit, else one group.

temps

For what = "draws", numeric vector of assay temperatures (°C) to evaluate the curve parameters at, passed to extract_4pl_pars(). NULL (default) uses the fit's observed unique assay temperatures. Ignored for what = "summary" (which always reports the T_bar slice).

Value

A tibble (plus the moderator column(s) for a grouped fit): for "summary", one row per parameter with median and credible bounds at T_bar; for "draws", one row per posterior draw × temperature with temp, low, up, k, mid (and .draw).

See Also

get_tls_est() for the derived TLS quantities; tdt_parameter_table() and extract_4pl_pars(), which this wraps.

Examples

## Not run: 
wf <- fit_4pl(standardize_data(my_data, temp = "temp", duration = "time",
                               n_total = "n", n_dead = "dead"))
get_4pl_est(wf, "summary")                 # low/up/k/mid median + 95% CrI
get_4pl_est(wf, "draws", by = "species")   # per-draw params, per group

## End(Not run)

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