System of linear equations: get approximate solution with non-negative coefficients

635 Views Asked by At

I'm looking for a process or algorithm to help me with the following problem. I have the following vectors in $\mathbb R^{3}$:

$$ \vec m_3 = \begin{bmatrix} 51.8\\ 2.9\\ 22.3 \end{bmatrix}, \vec a = \begin{bmatrix} 20\cr 2\cr 3 \end{bmatrix}, \vec b = \begin{bmatrix} 0.3\\ 0\\ 6.5 \end{bmatrix}, \vec c = \begin{bmatrix} 20\\ 2\\ 5 \end{bmatrix}$$

I want to express $\vec m_3$ in terms of the other three. The problem is I need the coefficients to be positive! The solution to this is

$$ \vec m_3 = 240.510\vec a + 76\vec b -238.025\vec c $$

Given that I need the coefficients to be positive, and I don't care about getting a strictly correct answer (close is good enough), is there an algorithm or process by which I can look for an approximate answer in order to get positive coefficients? The ideal candidate would itself have a parameter for just how relaxed the solution can be.

Currently, I'm thinking a brute force search around $\vec m_3$ in small steps is my only hope :-(

Edit: By close, I mean $\|(x_1\vec a + x_2\vec b + x_3\vec c) - \vec m_3\| \leq \epsilon$

2

There are 2 best solutions below

2
On BEST ANSWER

The nonnegative least squares problem is to minimize the norm of the residual $ Ax -b $ subject to the constraint that the components of $ x $ are nonnegative. This optimization problem could be solved using proximal algorithms, such as the projected gradient method. Matlab has a function that will solve this problem for you.

0
On

Use the greedy method.

Find the largest u such that $m_a = m-u\ a$ has all non-negative components.

Then find the largest v such that $m_b = m_a-v\ b$ has all non-negative components.

Finally, find the largest w such that $m_c = m_b-w\ c$ has all non-negative components.

The approximation is then $ua+vb+wc$.

I have no idea how good the resulting approximation will be. I only know that the coefficients will be non-negative.