Implementation of an algorithm that finds a vector x with all elements xi>=0 which minimizes |X*x-y|.
Literature: Rasmus Bro and Sijmen De Jong, 'A fast non-negativity-constrained least squares algorithm', Journal of Chemometrics, Vol. 11, 393-401 (1997)
Algorithm modified by Dirk Lellinger 2015 to allow a mixture of restricted and unrestricted parameters.
Static member | Description |
Full Usage:
FastNonnegativeLeastSquares.Execution(XtX, Xty, isRestrictedToPositiveValues, tolerance, x, w)
Parameters:
IROMatrix<float>
-
X transposed multiplied by X, thus a square matrix.
Xty : IROMatrix<float>
-
X transposed multiplied by Y, thus a matrix with one column and same number of rows as X.
isRestrictedToPositiveValues : Func<int, bool>
-
Function that takes the parameter index as argument and returns true if the parameter at this index is restricted to positive values; otherwise the return value must be false.
tolerance : Nullable<float>
-
Used to decide if a solution element is less than or equal to zero. If this is null, a default tolerance of tolerance = MAX(SIZE(XtX)) * NORM(XtX,1) * EPS is used.
x : byref<IMatrix<float>>
-
Output: solution vector (matrix with one column and number of rows according to dimension of X.
w : byref<IMatrix<float>>
-
Output: Lagrange vector. Elements which take place in the fit are set to 0. Elements fixed to zero contain a negative number.
|
Execution of the fast nonnegative least squares algorithm. The algorithm finds a vector x with all elements xi>=0 which minimizes |X*x-y|.
Literature: Rasmus Bro and Sijmen De Jong, 'A fast non-negativity-constrained least squares algorithm', Journal of Chemometrics, Vol. 11, 393-401 (1997) Algorithm modified by Dirk Lellinger 2015 to allow a mixture of restricted and unrestricted parameters.
|
Full Usage:
FastNonnegativeLeastSquares.Execution(XtX, Xty, tolerance, x, w)
Parameters:
IROMatrix<float>
-
X transposed multiplied by X, thus a square matrix.
Xty : IROMatrix<float>
-
X transposed multiplied by Y, thus a matrix with one column and same number of rows as X.
tolerance : Nullable<float>
-
Used to decide if a solution element is less than or equal to zero. If this is null, a default tolerance of tolerance = MAX(SIZE(XtX)) * NORM(XtX,1) * EPS is used.
x : byref<IMatrix<float>>
-
Output: solution vector (matrix with one column and number of rows according to dimension of X.
w : byref<IMatrix<float>>
-
Output: Lagrange vector. Elements which take place in the fit are set to 0. Elements fixed to zero contain a negative number.
|
Execution of the fast nonnegative least squares algorithm. The algorithm finds a vector x with all elements xi>=0 which minimizes |X*x-y|.
Literature: Rasmus Bro and Sijmen De Jong, 'A fast non-negativity-constrained least squares algorithm', Journal of Chemometrics, Vol. 11, 393-401 (1997) Algorithm modified by Dirk Lellinger 2015 to allow a mixture of restricted and unrestricted parameters.
|