spectrochempy.LSTSQ

class LSTSQ(**kwargs)[source]

Least-squares solution to a linear matrix equation.

Given a vector X and a vector Y, the equation A.X + B = Y is solved by computing A, and B that minimizes the Euclidean 2-norm || Y - (A.X + B) ||^2.

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.

Methods

LSTSQ.inverse_transform()

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

LSTSQ.itrans()

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

LSTSQ.trans()

Return the least square coefficients A and B.

LSTSQ.transform()

Return the least square coefficients A and B.

Examples using spectrochempy.LSTSQ

Solve a linear equation using LSTSQ

Solve a linear equation using LSTSQ