spectrochempy.CurveFit

class CurveFit(**kwargs)[source]

Use non-linear least squares to fit a function, f, to data.

It assumes Y = f(X, *params) + eps.

This is a wrapper to the scipy.optimize.curve_fit` function

Parameters
  • *datasets (one or two |NDDataset|’s or array-like objects) – If a single dataset Y is provided, the X data will be the x coordinates of the Y dataset, or the index of the data if not coordinates exists. If two datasets X, and Y are given, the x coordinates of Y are ignored and replaced by the X data.

  • maxiter (int, optional) – Maximum number of iterations, optional. Default is 3 * X.shape.

Methods

CurveFit.inverse_transform()

Return the reconstructed data from the A and B least-square coefficients.

CurveFit.itrans()

Return the reconstructed data from the A and B least-square coefficients.

CurveFit.trans()

Return the least square coefficients A and B.

CurveFit.transform()

Return the least square coefficients A and B.