some issues with leastsq

Peter Hinow hinow at uwm.edu
Tue Apr 5 23:46:29 CEST 2011


Dear scilab users,

first of all, is there a significant difference between datafit and leastsq? Which is better to use in which situation? I'm trying to fit the output of a parameter-dependent ODE model to some data, i.e. I'm trying to fit the solution of
y'(t;p) = f(y,p), y(0) = y_0
to some experimental data. I wrote an objective function that solves the ODE and calculates the sum of the squared deviations from the data. When I run it, I sometimes get the cryptic message

lsoda--  at t (=r1), mxstep (=i1) steps   
needed before reaching tout
      where i1 is :        500                                                  
      where r1 is :   0.1494242403106D-01                                       
Warning:  Result may be inaccurate.

 !--error 21 
Invalid index.

This was with the standard algorithm (i.e. 'qn'). I also tried to require a bound on the gradient for termination, so I use something like
leastsq( ..... , 'ar', 1e8, 1e8, 1e11),
but at the end I still get a gradient that has norm 1e24. Is there a way to write out why the search terminated?
I of course can share more of my code, it's fairly simple, actually.

Thank you and best regards all,
       Peter

-- 
Peter Hinow, PhD
Department of Mathematical Sciences
University of Wisconsin - Milwaukee
P.O. Box 413
Milwaukee, WI 53201-0413
USA
phone: ++1 414 229 4933
https://pantherfile.uwm.edu/hinow/www/




More information about the users mailing list