Given the input-output relation:
$ \begin{pmatrix} y_1 \\ y_2 \end{pmatrix} =p_1 \begin{pmatrix} p_2 & p_3 \\ p_4 & p_4 \end{pmatrix} * \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} + \begin{pmatrix} p_5 \\ p_6 \end{pmatrix} $
with $p_1-p_6$ parameters.I want to minimize the least square error using Gauss-Newton method. Suppose we have 100 measurements. My question is about calculation and size of residual vector.
$ r_i = output - f(input,parameters) \\ \begin{pmatrix} r_1 \\ r_2 \end{pmatrix} = \begin{pmatrix} y_1 \\ y_2 \end{pmatrix} - \Bigg( p_1 \begin{pmatrix} p_2 & p_3 \\ p_4 & p_4 \end{pmatrix} * \begin{pmatrix} x_1 \\ x_2 \end{pmatrix} + \begin{pmatrix} p_5 \\ p_6 \end{pmatrix}\Bigg) $
In order to calculate minimised-error parameters, we have:
$ p_{i+1}=p_i+\Delta \\\Delta=(J_f^TJ^T)^{-1}J_f^Tr_i $
the size of each is as follows:
$ input vector :100*2\\ output vector :100*2\\ r:\quad\quad\quad\quad\quad100*2\\ J_f : \quad\quad\quad\quad100*6\\ p_i:\quad\quad\quad\quad\quad6*1 (six \quad parameters) $
As you can see, the size of $\Delta$ would be 6x2 that seems not consistent with $p_{i+1}$
Now is my residual vector calculation process right? if yes how can I compute parameter's vector? And if not what is the correct answer?
Thank you so much.