1. Yes I did set scales but it is hard for me to know the shape ahead of time so the best I can do is to set them more or less equal, at least not orders or magnitude apart.
2. A very simple example is the following parabola:
errorValues[0] = x;
errorValues[1] = 1000*y;
obviously this is only a dumb example because scaling can help, but let's assume we don't know that since in real world that's what I am facing. Initial value is x=1, y=1. The path the optimizer takes is to reduce y to almost zero and then start to bounce in the valley.
Here is what I added to alglib.minlm.minlmiteration(minlmstate state) function:
Code:
lbl_5:
state.needfi = false;
state.repnfunc = state.repnfunc+1;
state.repnjac = state.repnjac+1;
//
// New model
//
state.modelage = 0;
// the following are added
state.lambdav = double.PositiveInfinity;
double factor = 0.01;
for (i = 0; i < n - 1; i++)
{
double tmpLambdav = factor * Math.Abs(state.quadraticmodel[i, i]) * Math.Sqrt(state.s[i]);
if (tmpLambdav > double.Epsilon)
state.lambdav = Math.Min(state.lambdav, tmpLambdav);
}
if (double.IsInfinity(state.lambdav))
state.lambdav = 1;