Re: non-linear regression update.



Thanks a lot for the response.

I have made a small correction.  Now I can (almost) guarantee
termination.

My change:
line 407
was: if (chi_pos <= chi_pre) {
now: if (chi_pos <= chi_pre + DELTA/2) {


Here is why convergence is *almost* guaranteed.

It's all about the 'r' term.  It's similar to a step size - excpet that
larger values would be a "smaller step". Look at coefficient_matrix() for
details.

This is what my program does:

1) Whenver an iteration fails to reduce Chi Squared, the new values are
rejected and r is increased.

2) This terminates when Chi Squared improves, but only by a small
ammount.

Another property of r is that larve values make the change in Chi Squared
smaller.

Now, suppose that we get to a point where Chi Squared will never improve.
This is what happens then:

1.- On each iteration, r gets larger.
2.- The change in Chi Squared gets smaller approaching 0.
3.- Eventually the change is small enough that the loop terminates
    anyways.


Once again, thanks for the help.

Daniel.

PS:

The reason why convergence is not guaranteed is that there's a chance that
the coefficient matrix will be singular.  However, this is unlikely
because the LM method has a tendency to move away from such situations.

Now, if the matrix is sigular, linear_solve() will cause an error and the
loop will still terminate (the function then returns that error).


On Mon, 27 May 2002, Andreas J. Guelzow wrote:

How do you _guarantee_ termination of your while(1) loop ? While I can
see that normally you will terminate I don't see a reason why a well
crafted example could not run unterminated (it probably doesn't help my
understanding that I don't seem to see a use of r in non_linear_regression.

Andreas






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]