I am trying to implement a linear regression algorithm to fit a set of "true" points with their "observed" location. The points are specified using spherical coordinates on a unit sphere.
I have a model that relates true to observed as follows: $$ y_{1} = x_{1} + a_{0}*Q_{0}\left(x_{1},x_{2}\right) + a1*Q_{1}\left(x_{1},x_{2}\right) + ... a_{4}*Q_{4}\left(x_{1},x_{2}\right)\\ y_{2} = x_{2} + b_{0}*R_{0}\left(x_{1},x_{2}\right) + b_{1}*R_{1}\left(x_{1},x_{2}\right) + ... b_{4}*R_{4}\left(x_{1},x_{2}\right) $$ where $\left(y_{1},y_{2}\right)$ is the "true" spherical point, and $\left(x_{1},x_{2}\right)$ is the "observed" spherical point, and a0..a4 and b0..b4 are coefficients to be fitted, and $Q_{i}\left(x_{1},x_{2}\right)$ and $R_{i}\left(x_{1},x_{2}\right)$ are (typically) trigonometric functions on the true point and provide the independent variables.
One constraint is that some of the coefficients $b_{0}..b_{4}$ are actually shared with the first equation. So we could say that (for example), $b_{0}..b_{2}$ = $a_{0}..a_{2}$.
I understand how to do the regression with just one equation, but because the two equations are related through shared coefficients, I do not think it will work to regress them separately.
So my question is, how to do a regression to fit the coefficients for both equations at once? Please ask if you need more information to help me.