## Comparison of deviations for the cases quadratic and 0.5

It seems that the most deviated neurons are the same in both cases:

>> alfa=0.05; beta=1.5;
>> alfa=10^-1.1; beta=10^-.9; pot=.5;
>> [pos_cm,omega_general]=coste2pos_restofijas(todas.A*alfa,todas.M*beta+todas.S,todas.f,todas.pos_real,pot,.2);
>> desv_cerocinco=abs(pos_cm-todas.pos_real);
ans =
0.0879
>> mean(desv_cerocinco)
ans =
0.0911
>> figure

Some neurons are quite deviated in one case and not the other. However, it seems that these neurons have shallow costs for both cases, as we see when we use the predictions of the quadratic case for the deviations of the 0.5 case (note that beta is very different in either case):

>> alfa=0.05; beta=1.5;
>> omega=sum([todas.A*alfa todas.M*beta+todas.S],2);
>> figure
>> plot(desv_cerocinco,omega,’.’)

## Is the system trapped in a local mÃ­nimum?

Clear
>> alfa=10^-1.1; beta=10^-.9; pot=.5;
for c=1:100
pos_opt(1:279,c)=coste2pos_num_ruido(todas.A*alfa,todas.M*beta+todas.S,todas.f,pot,0,1,1);
hold on
end

Now, run the optimization with the real position as starting point (red line)

I modify coste2pos_num_ruido,

pos=rand(n_neuronas,1);

% **

pos=todas.pos_real;

% **

c_iteraciones=1;

>> pos_opt_cercareal=coste2pos_num_ruido(todas.A*alfa,todas.M*beta+todas.S,todas.f,pot,0,1,1);

for c=1:100
costes(c)=pos2coste(todas.A*alfa,todas.M*beta+todas.S,todas.f,pos_opt(:,c),pot);
end
>> [m,ind_min]=min(costes);
>> pos_opt_min=pos_opt(:,ind_min);
>> mean(abs(pos_opt_min-pos_opt_cercareal))
ans =
0.0842
>> vector=todas.pos_real-pos_opt_min;
>> coef=-.5:.05:1.5;
>> for c=1:length(coef)
coste_vec(c)=pos2coste(todas.A*alfa,todas.M*beta+todas.S,todas.f,pos_opt_min+vector*coef(c),pot);
end
>> figure
>> plot(coef,coste_vec)

There is a smooth way to the optimum, although my optimizer is unable to find it. So it does not look like a local minimum in the general multidimensional surface (although in some directions there are local minima, klar)