0
$\begingroup$

(apologies for the n00b question)

Let's say we have a vector of length $n$, with to-be-determined values: $a_1, a_2, ...,a_n$.

And we have information that partial sums of these elements are equal to something, say: $$ a_1 + a_2 + ... + a_{k_1} = A_{1} \\ a_{k_1+1} + a_{k_1+2} + ... + a_n = B_1 \\ a_1 + a_2 + ... + a_{k_2} = A_2 \\ a_{k_2+1} + a_{k_2+2} + ... + a_n = B_2 \\ ...\\ a_1 + a_2 + ... + a_{k_m} = A_m \\ a_{k_m+1} + a_{k_m+2} + ... + a_n = B_m \\ $$

Where $m<<n$: so we have much fewer such $m$ equations/constraints than the $n$ unknown values $a_i$.

If we want to know which combination of $a_i$ values can solve these equations, there are probably infinite many such combinations (or 0). So I'd like to add two constraints to this:

  1. $a_i>0$ for any i.
  2. I want the solution with $a_i$ values that are as "similar" to each other as possible. For example, keeping $\sum_{i=1}^n (a_i - \bar a)^2$ as small as possible (L2 norm). Where $\bar a = \sum \frac{a_i}{n}$.

How is such optimization problem called? (would also love to know how to solve it, but I assume that once I have the name, I can find solvers).

$\endgroup$

1 Answer 1

3
$\begingroup$

If you are willing to replace $a_i > 0$ by $a_i \ge 0$, then this becomes a quadratic program. Indeed, it can be formulated as \begin{align*} \text{Minimize}\quad & \frac12 a^\top Q a + q^\top a, \\ \text{such that} \quad & C a = d, \\ & a \ge 0. \end{align*} Here, $Q$ and $C$ are matrices of appropriate size and $q$ and $d$ are vectors (these objects come from your data). Moreover, the matrix $Q$ is positive semidefinite.

[If you insist on keeping $a_i > 0$, the corresponding problem might fail to have solutions.]

$\endgroup$
7
  • $\begingroup$ I'm fine that a could be 0. Thanks for the response. So Ca=d is the equations I wrote above? $\endgroup$ Commented Jun 10, 2021 at 9:31
  • $\begingroup$ Yes, you encode these conditions via a linear system of equations. $\endgroup$ Commented Jun 10, 2021 at 11:25
  • $\begingroup$ Thanks. Any pointers for how to do this? When I look at wikipedia and software implementations they seem to require " A^T b >= b0". How then do I create a constraint that does "Ca = d"? $\endgroup$ Commented Jun 10, 2021 at 11:34
  • $\begingroup$ $Ca = d$ is equivalent to "$C a \le d$ and $Ca \ge d$". $\endgroup$ Commented Jun 10, 2021 at 13:23
  • 1
    $\begingroup$ @Tal Galili $Ca \ge d$ can be rewritten as $-Ca \le -d$ $\endgroup$ Commented Jun 11, 2021 at 0:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.