BiexponentialDecayWithOffset#

Module: exa.core.model_selection_fitter.models.exponential_offset_model

class BiexponentialDecayWithOffset(*args, independent_vars=None, **kwargs)#

Bases: BaseModel

Lmfit model for biexponential decay with constant offset.

This model describes data that decays biexponentially from an initial value toward a constant baseline offset. This happens when, for example, there is a TLS changing frequency on a timescale shorter than a T1 experiment, or there is hybridisation in the presence of dephasing.

The model function is:

\[\begin{split}f(x) = A_bi (\\alpha \exp(-x / \\tau_a) + (1-\\alpha) \exp(-x / \\tau_b)+ y_0_bi\end{split}\]
Parameter hints:
  • A_bi: Initial guess 1.0 (no bounds).

  • \\alpha: Initial guess 0.7, bounded between 0 and 1.

  • \\tau_a: Initial guess 30e-6 (30 μs), lower bound 1e-9.

  • \\tau_b: Initial guess 5e-6 (5 μs), lower bound 1e-9.

  • y_0_bi: Initial guess 0.0 (no bounds).

Initializes the BixponentialDecayWithOffset model.

Parameters:
  • args – Passed to parent __init__.

  • independent_vars (list[str] | None) – Independent variable names.

  • kwargs – Passed to parent __init__.

Attributes

Methods

guess

Estimate initial parameters for the decay.

guess(data, x, **kws)#

Estimate initial parameters for the decay.

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.

Alpha is taken as default.

The ‘major’ decay constant (tau_a) is estimated by finding the point where the data falls to 1/e of its initial amplitude above the offsets.

The ‘minor’ decay constant (tau_b) is taken to be tau_a/5.

If this estimation fails, a default value is used. The method ensures tau is positive and not too small

Parameters:
  • data (ndarray) – Dependent variable data.

  • x (ndarray) – Independent variable data.

  • kws – Values for the model parameters.

Returns:

Estimated parameters for fitting.

Return type:

Parameters

Inheritance

Inheritance diagram of exa.core.model_selection_fitter.models.exponential_offset_model.BiexponentialDecayWithOffset