Non-negative solution to matrix equation

281 Views Asked by At

I want to solve $Ax = b$ subject to the constraint that all of the elements of $x$ are non-negative. If such a solution does not exist, I want to find non-negative $x$ such that the quadratic form $(Ax - b)^T (Ax-b)$ is minimized. What kind of algorithm will let me do this?

1

There are 1 best solutions below

0
On BEST ANSWER

Put differently, you want to solve the following optimization problem $$ \min_x \|Ax-b\|^2\ \text{s. t.}\ x\geq 0. $$ This is a quadratic and convexly constrained minimization problem which can be solved in many ways. There are several software packages around to do the task, for example the quadprog routine of the Matlab Optimization toolbox should work here. However, the choice should at least depend on the size and the type of the matrix.