spectrochempy.LSTSQ¶
- class LSTSQ(**kwargs)[source]¶
Least-squares solution to a linear matrix equation.
Given a vector
X
and a vector Y, the equationA.X + B = Y
is solved by computingA
, andB
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, theX
data will be thex
coordinates of theY
dataset, or the index of the data if not coordinates exists. If two datasetsX
, andY
are given, thex
coordinates ofY
are ignored and replaced by theX
data.
Methods
Return the reconstructed data from the A and B least-square coefficients.
Return the reconstructed data from the A and B least-square coefficients.
Return the least square coefficients A and B.
Return the least square coefficients A and B.
Examples using spectrochempy.LSTSQ
¶
Solve a linear equation using LSTSQ