sigdrift_model: Sigmoidal-drift model with gradient

View source: R/analyse_sigmoidal_drift.R

sigdrift_modelR Documentation

Sigmoidal-drift model with gradient

Description

Model function of SSsigmoidal_drift(): sigmoidal_drift() plus the partial derivatives for the parameters written as bare symbols in the call (see free_params()), so stats::nls() skips stats::numericDeriv(). The sigmoid partials come from sigmoid_core(); the drift onset xmid + u_f / k moves with every sigmoid parameter through the rate k, and the hinge derivatives are one-sided at the onset.

Usage

sigdrift_model(
  t,
  A,
  B,
  xmid,
  slope,
  slope_B,
  drift_fraction,
  shape = "symmetric"
)

Arguments

t

A numeric vector of the predictor variable (time).

A

A numeric parameter for the starting asymptote of the response variable.

B

A numeric parameter for the ending asymptote of the response variable.

xmid

A numeric parameter for the time at the inflection point (the steepest point) of the curve, in units of the predictor variable t.

slope

A numeric parameter for the response rate dx/dt at the inflection xmid.

slope_B

A numeric parameter for the linear drift rate dx/dt of the secondary phase at the ending asymptote B, in response units per unit of the predictor variable t.

drift_fraction

A numeric fraction of the primary amplitude B - A in ⁠(0.5, 1)⁠ at which the linear drift begins, where the sigmoid reaches A + drift_fraction * (B - A).

shape

Character; the 4-parameter sigmoidal shape. One of "symmetric" (default; logistic()), "gompertz" (gompertz()), or "gompertz_left" (gompertz_left()).

Value

A numeric vector of predicted values with a "gradient" attribute when any parameter is free.


mnirs documentation built on Sept. 13, 2026, 1:06 a.m.