[Scilab-users] Error in Nelder-Mead functions

classic Classic list List threaded Threaded
2 messages Options
Mike Page-2 Mike Page-2
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] Error in Nelder-Mead functions

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.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Mike Page Mike Page
Reply | Threaded
Open this post in threaded view
|

Re: Error in Nelder-Mead functions

I have just checked on Scilab 5.3.2 and found this works on that version, so
it looks like a bug.

Mike.


-----Original Message-----
From: [hidden email]
[mailto:[hidden email]]On Behalf Of Mike Page
Sent: 13 March 2013 13:52
To: [hidden email]
Subject: [Scilab-users] Error in Nelder-Mead functions


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.

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users


-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.2904 / Virus Database: 2641/6168 - Release Date: 03/12/13

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users