since I am trying to find the fitting parameters for a model, sometimes I get this:
basically I have to have that the green curve (my model) at certain point should stop to oscillate, like the target (the blue one). The problem is that I am calculating the error using the sum of the squares and trying to minimize it with ModeFrontier ( an optimization software, that chose the parameter of my model trying to minimize the error). But if I calculate the error in that way,I get that the green curve in the picture is the best fit.
How can I calculate the error trying to eliminate the oscillation? Thanks