exponfit#
- torchspin.exponfit(x, y, n_exp=1, *, include_offset=True)[source]#
Fit exponential decay or recovery curves.
Fits the model:
\[y(x) = c_0 + c_1 \exp(k_1 x) + [c_2 \exp(k_2 x)]\]where
kvalues are negative for decay curves.- Parameters:
- Returns:
k – Decay rate constants (negative for decays). Shape
(n_exp,)for single series,(n_exp, M)for multiple.c – Linear coefficients
[c_0, c_1, ...](offset first if included). Shape(n_exp + offset, )or(n_exp + offset, M).yfit – Fitted function values, same shape as
y.
- Return type: