triqs.fit.fit.Fit

class triqs.fit.fit.Fit(x_array, y_array, fitter, p0=None)[source]

A simple general functional fit of a X,Y plot

Given a function f(x, p0,p1,p2 …) with parameters p0, …, p2, and an init guess it adjust the parameters with least square method.

The fitting is done at construction

self.param is the tuple of adjusted parameters.

The object is callable : self(x) = f(x, *self.param), so it can be plotted e.g.

Methods

__init__(x_array, y_array, fitter[, p0])

param x_array,y_array:

curve to fit, as two 1d numpy arrays