Funcfit: it seems the procedure is trying parameter values outside of the constraints

When I was fitting using my own function, I let the calculated curve update as the fitting was going on. I noticed that at some point, the calculated curve went to some crazy place, which should not happen if the values of parameters stay inside the constraints range I set.

Is it supposed to be like this, from the least square fitting algorithm?

Any idea will be much appreciated. (Sorry I could not provide my code here due to various reasons.)

-H.
The way constraints work is that at each iteration the Hessian matrix is computed, a new set of coefficients is estimated using that Hessian matrix. Then that new estimate is checked for constraint violations. If there are violations, a small optimizer is run to find the "best" way to move the coefficients back into the allowed space. That becomes the new set of coefficients for that iteration.

The scheme can be confused by "infeasible" constraints. A ridiculous example would be 1 < w[0] and w[0] > 2. Naturally, no one would write such a thing on purpose, but infeasible constraints are pretty easy to write that aren't that obvious. When faced with infeasible constraints, the system finds a compromise that tries to minimize the constraint violations.

If your basic fit is unstable, and some iteration goes off into cyberspace, it is possible that the optimizer that applies the constraints can fail. In that case, the whole fit goes south...

If you would like, you can send an Igor experiment file containing your fit function and data to support@wavemetrics.com for further investigation. You code and data would be treated as confidential information.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com