I have a set of $n$ starting vectors $\vec i_n$ and a target vector $\vec t$. I have a set of scaling factors $a_n$ for which I can compute the sum $\vec s$:
$$ \vec s = \sum_{i=1}^n {a_i \vec i_i} $$
For each set of $a_n$, we can compute the distance to target using:
$$ d = \left| \vec s - \vec t \right| $$
I want to find the local minima (if any) for $d$, under the following constraints:
- all starting vector coordinates and target vector coordinates are positive or $0$,
- all scaling factors must be non-negative real numbers.
Is there a practical numerical method for solving such problems?
Suppose we are given a target $\mathrm{y} \in \mathbb{R}^d$ and vectors $\mathrm{b}_1, \mathrm{b}_2, \dots, \mathrm{b}_n \in \mathbb{R}^d$. Let
$$\mathrm{B} := \begin{bmatrix} | & | & & |\\ \mathrm{b}_1 & \mathrm{b}_2 & \ldots & \mathrm{b}_n\\ | & | & & | \end{bmatrix}$$
We would like to find a vector $\mathrm{x} \in (\mathbb{R}_0^+)^n$ such that $\|\mathrm{B} \mathrm{x} - \mathrm{y}\|_2$ is minimized. This is an inequality-constrained least-squares problem. Hence, we have the following (convex) quadratic program
$$\begin{array}{ll} \text{minimize} & \|\mathrm{B} \mathrm{x} - \mathrm{y}\|_2^2\\ \text{subject to} & \mathrm{x}\geq 0_n\end{array}$$
which should be easy to solve, as it is convex.