[Scilab-users] Error in Nelder-Mead functions
Mike Page
mike.pageone at googlemail.com
Wed Mar 13 14:51:52 CET 2013
Hi,
I am trying to use the Nelder Mead optimisation functions to fit a
biological model to some experimental data. I am using Scilab 5.4.0 on Win
XP.
The search halts with the error:
!--error 21
Invalid index.
at line 78 of function neldermead_updatesimp called by :
at line 26 of function neldermead_autorestart called by :
at line 22 of function neldermead_search called by :
at line 37 of function CpeFit called by :
at line 13 of function TestFit called by :
TestFit
This line in neldermead_updatesimp seems to be "str = string ( simplex0 )".
If I turn on verbose mode, the problem happens here:
<snip>
Function Evaluation #42, index=2, x= [134014.18 0.0001 0.7648109 134014.18
0.0000012 0.7648109 134014.18 0.0000506 0.7648109 97.463]
Function Evaluation #43, index=2, x= [134014.18 0.0001 0.7648109 134014.18
0.0000012 0.7648109 134014.18 0.0000012 0.7648603 97.463]
Function Evaluation #44, index=2, x= [134014.18 0.0001 0.7648109 134014.18
0.0000012 0.7648109 134014.18 0.0000012 0.7648109 97.462951]
Before scaling:
Optim Simplex Object:
=====================
nbve: 11
n: 10
x: 11-by-10 matrix
fv: 11-by-1 matrix
!--error 21
<snip>
The Nelder Mead setup is as follows:
nm = neldermead_new ();
nm = neldermead_configure (nm, "-method", "box");
// nm = neldermead_configure (nm, "-verbose", 1);
nm = neldermead_configure (nm, "-numberofvariables", 10);
nm = neldermead_configure (nm, "-maxfunevals", 1000);
nm = neldermead_configure (nm, "-maxiter", 1000);
nm = neldermead_configure (nm, "-restartflag", %t);
nm = neldermead_configure (nm, "-boxtermination", %t);
nm = neldermead_configure (nm, "-function", CpeLossFunc);
nm = neldermead_configure (nm, "-boundsmin", ...
[1.0E3; 1.0E-9; 0.1; 1.0E3; 1.0E-9; 0.1; 1.0E3; 1.0E-9; 0.1; 10.0]);
nm = neldermead_configure (nm, "-boundsmax", ...
[10.0E6; 100.0E-6; 0.9; 10.0E6; 100.0E-6; 0.9; 10.0E6; 100.0E-6;
0.9; 10.0E3]);
nm = neldermead_configure (nm, "-x0", Values);
nm = neldermead_search (nm);
Values = neldermead_get (nm, "-xopt");
disp (neldermead_get (nm, "-status"));
nm = neldermead_destroy (nm);
Anyone have any ideas what is wrong?
Cheers,
Mike.
More information about the users
mailing list