I have five sets of observations of measured y as some function of measured $x_1, x_2, x_3,\ldots$ and I want to fit five functions to these observations. They have the form $$ y = f(x_1, x_2, x_3,\ldots, a_1, a_2, a_3,\ldots) $$ Where the $a_1, a_2,\ldots$ are fitting parameters.
I can use least squares to find the least-squares best fitting parameters for each individual set of observations, but as it happens, this isn't what I really need. Instead it is thought that the physical meaning behind the fitting parameters is such that for all five sets of observations some of the fitting parameters, say $a_3$ & $a_4$, should be the same, but the $a_1$ and $a_2$ should be different for each set.
So I need to find a "globally" "optimal" (in some sense) $a_3$ and $a_4$, and then the best fit $a_1$ & $a_2$ for each observation set.
Can somebody suggest a way to approach this, and if there are standard techniques for it?
I'm aware that people in some fields approach this by iteratively trying to find the best fit $a_3$, $a_4$ by treating the five sets of observations as one big set, and then they fix those parameters and then split into five sets again and then solve for the $a_1$ & $a_2$. And more elaborate iterative approaches are used, but I've never seen this described in a text on numerical methods, and the method is used by metallurgists and other professionals who may not be appreciating how meaningful, or not, their algorithm to solving the problem. So I have doubts about using that approach (are they just getting the numbers they want to see, rather than physically meaningful numbers?)- unless there is good reason to believe that it is effective?