Click or drag to resize

FloatNonnegativeLeastSquares(FloatMatrix, FloatVector, Boolean, Single) Constructor

Constructs a nonnegative least squares solution for the given linear system Ax = y, optionally adding an intercept parameter to the model.

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public FloatNonnegativeLeastSquares(
	FloatMatrix A,
	FloatVector y,
	bool addIntercept,
	float tolerance
)

Parameters

A  FloatMatrix
The matrix.
y  FloatVector
The right hand side.
addIntercept  Boolean
If true, a column of ones is prepended to a deep copy of matrix A before solving for the nonnegative least squares solution. This corresponds to adding an intercept parameter to the model. Note: the input matrix A is not changed.
tolerance  Single
Specifies a tolerance for detecting rank deficiency while solving the nonnegative least squares problem.
Exceptions
ExceptionCondition
MismatchedSizeExceptionThrown if the number of rows in A is not equal to the length of y.
NMathExceptionThrown if the specified maximum number of iterations performed by the algorithm was exceeded.
Remarks
The nonnegative least squares algorithm is an iterative algorithm which may solve an unconstrained least least squares problem, Bx = y, during an iteration. If the matrix B is rank deficient (has less than full rank) the solution is not unique and is somewhat suspect. If such a rank deficiency is detetected while performing the nonnegative least squares algorithm the RankDeficiencyDetected property will return true.
See Also