Nothing
#' Fit a four-parameter log-normal thermal-survival curve
#'
#' Fits the same response likelihoods, direct `CTmax`/`z` coordinates, and
#' shape designs as [fit_tls()], with the log-normal mean curve
#' `low + (up - low) * pnorm(-k * (log10(duration) - mid))`. Here `mid` remains
#' the halfway point between `low` and `up`. The interpretation of `k` is
#' curve-specific; its normalized midpoint slope magnitude is
#' `k / sqrt(2 * pi)`.
#'
#' @param ... Arguments forwarded to [fit_tls()], including either its column or
#' formula interface. The curve is fixed to `"lognormal"`.
#' @param curve Do not supply. This fitter fixes the curve to `"lognormal"`.
#' @return A `profile_tls` maximum-likelihood fit from [fit_tls()].
#' @examples
#' d <- simulate_tls(family = "binomial", curve = "lognormal",
#' CTmax = 36, z = 4, seed = 1)
#' fit <- fit_lognormal(
#' d, y = survived, n = total, time = duration, temp = temp,
#' family = "binomial", tref = 1
#' )
#' fit$curve
#' @export
fit_lognormal <- function(..., curve = NULL) {
if (!is.null(curve)) {
cli::cli_abort("{.arg curve} is fixed to {.val lognormal} in {.fn fit_lognormal}.")
}
fit_tls(..., curve = "lognormal")
}
#' Fit a four-parameter Weibull thermal-survival curve
#'
#' Fits the same response likelihoods, direct `CTmax`/`z` coordinates, and
#' shape designs as [fit_tls()], with a midpoint-centred Weibull mean curve.
#' Type 1 is Gompertz-shaped on log time; type 2 is inverse-Weibull (Frechet).
#' Both use `mid` for the halfway point between `low` and `up`. The normalized
#' midpoint slope magnitude is `k * log(2) / 2`, so the interpretation of `k` is
#' curve-specific.
#'
#' @param ... Arguments forwarded to [fit_tls()], including either its column or
#' formula interface. The curve is fixed by `type`.
#' @param type Integer `1` (default) for Weibull type 1 or `2` for Weibull type 2.
#' @param curve Do not supply. This fitter selects the curve from `type`.
#' @return A `profile_tls` maximum-likelihood fit from [fit_tls()].
#' @examples
#' d <- simulate_tls(family = "binomial", curve = "weibull2",
#' CTmax = 36, z = 4, seed = 1)
#' fit <- fit_weibull(
#' d, type = 2, y = survived, n = total, time = duration, temp = temp,
#' family = "binomial", tref = 1
#' )
#' fit$curve
#' @export
fit_weibull <- function(..., type = 1, curve = NULL) {
if (!is.null(curve)) {
cli::cli_abort("{.arg curve} is fixed by {.arg type} in {.fn fit_weibull}.")
}
if (!is.numeric(type) || length(type) != 1L || is.na(type) ||
!is.finite(type) || !type %in% c(1, 2)) {
cli::cli_abort("{.arg type} must be 1 (Weibull type 1) or 2 (Weibull type 2).")
}
fit_tls(..., curve = if (type == 1) "weibull1" else "weibull2")
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.