ExponentialDecayWithOffset#
Module: exa.core.model_selection_fitter.models.exponential_offset_model
- class ExponentialDecayWithOffset(independent_vars=None, **kwargs)#
Bases:
BaseModelLmfit model for single-exponential decay with constant offset.
This model describes data that decays exponentially from an initial value toward a constant baseline offset.
The model function is:
\[\begin{split}f(x) = A \exp(-x / \\tau) + y_0\end{split}\]- Parameter hints:
A: Initial guess 1.0 (no bounds).\\tau: Initial guess 30e-6 (30 μs), lower bound 1e-9.y_0: Initial guess 0.0 (no bounds).
Initializes the ExponentialDecayWithOffset model.
- Parameters:
Attributes
Methods
Estimate initial parameters for exponential decay with offset.
- guess(data, x, **kws)#
Estimate initial parameters for exponential decay with offset.
For non-trivial data, it estimates the amplitude as the difference between the first and last data points, and the offset as the last data point.
If the amplitude is close to zero, it uses the range of the data as the amplitude and the minimum value as the offset.
The decay constant (tau) is estimated by finding the point where the data falls to 1/e of its initial amplitude above the offsets.
If this estimation fails, a default value is used. The method ensures tau is positive and not too small
Inheritance
