Constrained Least Square Regression
I have numerous values gathered experimentally.
F1(x,y), F2(x,y), F3(x,y), etc ...
I want to obtain a function based on these values
that will present maximum at some specifics x (which varies for each y). I know where these maximum will be (on which x) and how many.
I don't really care of the final values of the resulting function as long as it shows the maximums where I expect them to be
Presently I am doing a first regression over x and y simultaneously using (for Yr = 1 where I want the maximums and 0 where I dont) for a function R(x,y)=A + B*F1(x,y) + C*F1(x,y)^2 + D*F1(x,y)^3 + E*F2(x,y) + F*F2(x,y)^2 + G*F2(x,y)^3 + ...
S = SumX SumY (R - Yr)^2 - dS/dA = 0, dS/dB =0, dS/dC =0, etc ...
Then I am doing an average between the original vector (of 1 and 0) and the resulting function R(x,y) = Yr' for a second regression pass.
S = SumX SumY (R - Yr')^2
And so on for several regression pass.
The problems are: my maximums drift (they shift from one x values to another one) ... After few pass, the maximums end up being lower than some other values of R (for the same y).
Is there any way (mathematically) to constrained the regression to present maximums at some specific x ?