gsl_multimin question (Correction)
Fabrice Rossi
rossi@ufrmd.dauphine.fr
Tue Jun 3 19:04:00 GMT 2003
Rajarshi Guha wrote:
> On Tue, 2003-06-03 at 14:36, Rajarshi Guha wrote:
>
> >On Tue, 2003-06-03 at 13:13, Fabrice Rossi wrote:
> >
> >>Hi.
> >>
> >>Could you show the code? Are you sure the derivatives are correct?
>
>
> >I've selected the initial argument vector randomly, but the values are
> >close to the target vector. I expected that the values printed in each
> >iteration should converge to my target vector - but they dont and after
> >a few iterations all I see is NaN's.
>
>
> Sorry about this - but in fact it does converge to the target values.
> However after convergence it does not stop and carries on and then I see
> NaN's.
>
> The thing I noted was that at convergence the value of the function is 0
> - I figured that might be causing the minimization to screw up. So I
> rewrote the function as
>
> E' = 1 + E
>
> and now it stops and gives the correct values
>
> Is this the right way to go about it?
Well, I don't know if this is the right way to do, but I remember that
when I worked on the multimin part, I had serious concern about stopping
criterion. I guess some work is needed! Anyway, I'm not that surprised
that something goes wrong when the solution goes to zero in your problem
because square root has not derivative in zero, so your gradient is
going to infinity... So you shoud minimize directly sum and not sqrt(sum).
Fabrice
More information about the Gsl-discuss
mailing list