clear
format long e
format compact
global zxvar
load /home/erm/data/hsdata3
Scale=[..
     3.713463055609829e+00
     1.820241023930575e-01
     3.631638128495613e-01
     3.847661396160699e-01
     5.011854169597414e+00
     1.004936555742038e-01
     9.701258160371268e-01
     2.941184323711709e-02
     2.353547359639195e-02
     2.575768804517562e+00
     9.922124018722631e-01
     8.045572387573250e+01
     7.260533570773907e-05
     1.504348121424597e-04
     1.558529138737276e+03
     3.342363501438067e+03
     1.419938856306720e-06
     8.501094290839163e-06
     1.391249453690890e-05
     1.198197858126918e-05
     1.407384498230699e-05];

lb1=[-10;1e-8;1e-8;.2;.01;.0001; .6;-.5;.02;.0075; .96;    1;1e-8;
    1e-8;    1;    1;-.99;-.99;-.99;-.99;-.99]./Scale;
ub1=[ 10;  .8;  .5;.8; 10;   10;1.1; .3;.03;   10;.999;10000;  .1;
      .1;10000;10000; .99; .99; .99; .99; .99]./Scale;
lb=min(lb1,ub1); ub=max(lb1,ub1);

x=ones(21,1);
[L,dL]=mle(x);
rand('normal')
rand('seed',3462)

better=[x];
good=[x];
for i=1:1000;
  p=rand(x);
  lambda=1;
  for j=1:20;
    if (x+lambda*p>lb & x+lambda*p<ub)
      y=mle(x+lambda*p);
      if y<L; other=[other,x+lambda*p]; disp('found one'); end;
      if y<L-1e-8; good=[good,x+lambda*p]; disp('found a good one'); end;
    end;
    lambda=lambda*.1; 
  end;
end;
