triqs.fit

Lightweight least-squares curve fitting for 1D data.

This module wraps scipy.optimize.leastsq() in a small, plotting-friendly Fit class. A fit is performed at construction time, the resulting object is callable (fit(x) returns the fitted model evaluated at x) and stringifies to a LaTeX expression – so it slots directly into triqs.plot.mpl_interface.oplot().

Two ready-made model definitions are provided as convenience fitter tuples: linear and quadratic.

It is imported with the command:

>>> from triqs.fit import Fit, linear, quadratic

Modules

fit

Least-squares fit of a parametric model to 1D data.