expdrift_model: Exponential-drift model with gradient

View source: R/analyse_exponential_drift.R

expdrift_modelR Documentation

Exponential-drift model with gradient

Description

Model function of SSexponential_drift(): exponential_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 hinge derivatives are one-sided at the drift onset.

Usage

expdrift_model(t, A, B, tau, slope_B, drift_fraction, TD = NULL)

Arguments

t

A numeric vector of the predictor variable (time).

A

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

B

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

tau

A numeric parameter for the time constant (\tau) of the exponential response, in units of the predictor variable t.

slope_B

A numeric parameter for the linear drift rate dx/dt of the secondary phase, 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 primary response reaches A + drift_fraction * (B - A).

TD

A numeric parameter for the time delay before the onset of the exponential response, in units of the predictor variable t. If NULL (default), a 3-parameter model without time delay is used.

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.