DoubleExponentialDecay

DoubleExponentialDecay#

Module: exa.core.model_selection_fitter.models.double_exponential_decay_model

class DoubleExponentialDecay(independent_vars=None, **kwargs)#

Bases: BaseModel

Lmfit model for double-exponential decay w.

This model describes data that decays as the sum of two exponential components

The model function is:

\[f(x) = a1 * rate1^(-x) + a2 * rate2^(-x)\]
Parameter hints:
  • a1: Initial guess 1.0 (no bounds).

  • rate1: Initial guess 2, lower bound 0.01, upper bound 5.0.

  • a2: Initial guess 0.1 (no bounds).

  • rate2: Initial guess 1.05, lower bound 0.01, upper bound 2.0.

Initializes the DoubleExponentialDecay model.

Parameters:
  • args – Passed to parent __init__.

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

  • kwargs (Any) – Passed to parent __init__.

Attributes

Methods

guess

Estimate initial parameters for double-exponential decay with offset.

guess(data, x, **kws)#

Estimate initial parameters for double-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 the initial x is 0 the amplitude a1 is the first data point. otherwise we set it to 1.0

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

We set a2 to a1/10 and rate2 to rate1*10

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.double_exponential_decay_model.DoubleExponentialDecay