1
$\begingroup$

firstly I need to apologize for my non mathematical language. Secondly I'll try to explain what I would like to calculate:

I have 3 series/rows of numbers and every series has 5 numbers(for example):

1.series: 2,4,9,1,7

2.series: 3,1,8,6,2

3.series: 8,0,6,0,9

sum of their columns should be as close as possible to this result:

result: 90,60,70,21,45

any series may/may not be multiplied by any multiplier

Could someone advice me what method shall be used for the calculation please? Any help is greatly appreciated

Thank you

nickzde

2 Answers 2

0

Put the system in the form $ Xw = y $ i.e. (note each series is in a column of $X$) $ \begin{pmatrix} 2 & 3 & 8 \\ 4 & 1 & 0 \\ 9 & 8 & 6 \\ 1 & 6 & 0 \\ 7 & 2 & 9 \end{pmatrix} \begin{pmatrix} w_1 \\ w_2 \\ w_3 \end{pmatrix} = \begin{pmatrix} 90 \\ 60 \\ 70 \\ 21 \\ 45 \end{pmatrix} $ Now to solve for $w,$ you can approximate it using least-squares as follows: $ Aw = y \\ A^{T} A w = A^{T} y \\ w = (A^{T} A)^{-1} A^{T} y \\ $ This will work as long as $A^{T} A$ is invertible.

  • 0
    Thank you very much for your help. I have posted new question [link](http://math.stackexchange.com/questions/126992/set-boundary-for-least-square-calculation). We can meet there again :) Have a nice day.hugo2019-03-26
0

Let say you multiply the rows by $a,b$ and $c$, respectively. Then if you add them up you get the following system of equations $2a+3b+8c=90$, $4a+1b+0=60$, $9a+8b+6c=70$, $1a+6b+0c=21$ and $7a+2b+9c=45$. You can solve the system of equations as usual.

  • 0
    Hello, thank you very much for your answer. Is it possible to alter these equations> 2a+3b+8c=90 ...etc. in such a way they would implement not only a,b,c but also d,e,f.....in the case there was more series than just 3? Again many thanks.2012-04-01