Question: How to deal with the error:(in GlobalOptimization:-GlobalSolve) Matrix index out of range ?

March 13 2012 axiuluo6611 0

0

Hi,

   The error showed up whenever I tried to do the Maximum Likelihood Estimation with Global Optimization Toolbox.My objective (likelihood ) function f is defined as follows(A1 to A5 are intermediate variables; parameters  are x[1] to x[12]):

   f := 0;

   for j from 1 by 1 to 21 do

       A1 := exp(x[1]+x[2]*c[j]);

       A2 := exp(x[3]+x[4]*c[j]);

       A3 := a[j]-x[5]-x[6]*b[j];

       A4 := a[j]-x[7]-x[8]*b[j];

       A5 := x[9]+x[10]*c[j];

       A6 := x[11]+x[12]*c[j];

       f := f-log((1+A1)*exp(-A3^2/(2*exp(A5))-.5*A5)/(sqrt(2*Pi)*(2+A1+A2))+(1+A2)*exp(-A4^2/(2*exp(A6))-.5*A6)/(sqrt(2*Pi)*(2+A1+A2)))

end do :

And extension of f  is substituted for the f in the following GlobalSolve function. And then the error will rise up. 

GlobalSolve(f, x[1] = -10 .. 10, x[2] = -10 .. 10, x[3] = -10 .. 10, x[4] = -10 .. 10, x[5] = -10 .. 10, x[6] = -10 .. 10, x[7] = -10 .. 10, x[8] = -10 .. 10, x[9] = -10 .. 10, x[10] = -10 .. 10, x[11] = -10 .. 10, x[12] = -10 .. 10)

 

Would somebody be kind enough to tell me how to deal with the error. Thanks a lot!

 

Please Wait...