Suppose that I have several $x_i$ variables ($0 \le i \lt N$). And I have equations of the form: $$w_0x_{n_0}x_{n_1} + w_1x_{n_2}x_{n_3} + w_2x_{n_4}x_{n_5} + w_3x_{n_6}x_{n_7} = K_0$$ $$w_4x_{n_8}x_{n_9} + w_5x_{n_{10}}x_{n_{11}} + w_6x_{n_{12}}x_{n_{13}} + w_7x_{n_{14}}x_{n_{15}} = K_1$$ $$w_8x_{n_{16}}x_{n_{17}} + w_9x_{n_{18}}x_{n_{19}} + w_{10}x_{n_{20}}x_{n_{21}} + w_{11}x_{n_{22}}x_{n_{23}} = K_2$$ $$\vdots$$
So, these $x_i$ variables multiplied together in pairs (variable indices are $n_*$), pairs are weighted, then summed. These equations form an overconstrained system (there are way more equations than $N$).
Is there a method which can find optimal $x_i$ values for particular $n_*$, $w_*$ and $K_*$ values? Supposedly in a least squares manner.
By optimal, I mean: let's say, that the actual value of each sum is $A_*$:
$$w_0x_{n_0}x_{n_1} + w_1x_{n_2}x_{n_3} + w_2x_{n_4}x_{n_5} + w_3x_{n_6}x_{n_7} = A_0$$ $$w_4x_{n_8}x_{n_9} + w_5x_{n_{10}}x_{n_{11}} + w_6x_{n_{12}}x_{n_{13}} + w_7x_{n_{14}}x_{n_{15}} = A_1$$ $$w_8x_{n_{16}}x_{n_{17}} + w_9x_{n_{18}}x_{n_{19}} + w_{10}x_{n_{20}}x_{n_{21}} + w_{11}x_{n_{22}}x_{n_{23}} = A_2$$ $$\vdots$$
I'd like to have $x_i$, for which the sum $$\sum_j{(K_j-A_j)^2}$$ is the least.