Expfit is a lightweight Python package to fit exponentials to noisy time series, typically with the aim of extracting time constants.
It aims to meet the following goals:
- Fit scaled and vertically transposed exponentials
y = a + b * exp(c * x)without requiring initial parameter estimates. - Fit double, triple, and quadruple exponentials
y = a + b_i * exp(c_i * x)where each exponential term is decaying (c_i < 0) and allb_ihave the same sign. - Fit multiple decaying exponentials in data with multiple
b_isigns. - Be lightweight: use good initial strategies and properties of exponentials to simplify the optimisation problem.
Although a relatively simple task, expfit has unit tests, and reported
failures will be added to its test suite to create a reliable tool for this
sometimes fiddly operation.
Does single exponentials well
Building on initial guesses for single, also started adding double which it does OK
To install from the repo, use e.g.
python setup.py install -e .
Tests can then be run with
python -m unittest
And coverage can be tested with
python -m coverage run
python -m coverage report