fit_biexponential: Fit a biexponential model to one channel

View source: R/analyse_biexponential.R

fit_biexponentialR Documentation

Fit a biexponential model to one channel

Description

Channel fitter of analyse_biexponential() (see analyse_kinetics_channels()), in two stages. Stage 1 fits the fast phase as a monoexponential on the end_window window (fit_monoexponential()). Stage 2 fits the full SSbiexponential() model on the whole response via stats::nls() with algorithm = "port", A, tau, and TD box-bounded about their stage-1 values by the ⁠*_flex⁠ half-widths and B, B2, tau2 free, seeded by biexp_start() with the fast phase held. A failed stage returns NA, and the fallback chain resolves the row upstream.

Usage

fit_biexponential(x, t, valid, .a, ctx)

Arguments

x, t

Numeric vectors of the channel response and time elapsed from start_time.

valid

The find_kinetics_idx() result for the channel.

.a

The resolved argument list of the channel.

ctx

The channel context list of analyse_kinetics_channels().

Value

The coefs/model/fitted_data/diag list of build_fit_results(), or build_na_results() when a stage fails.


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