## Branching in neurons: Looks good

I will calculate the diameter of mother branches, instead of the diameter of children branches.

Advantage: Only one branch is used per calculation, while if we calculate the children we use each branch twice.
Note: It is unclear to me which is the correct way of doing it. Depends on what is actually tuned in the animal, and that is unknown (it will probably be a combination of the three diameters).

>> diametros_opt=primarios_opt(diametros,bifurcaciones,3);
>> plot(abs(diametros-diametros_opt),longitudes,’.’)
>> xlabel(‘Deviation (\mum)’)
>> ylabel(‘Length (mm)’)

Looks right, but lacking statistics. I remove the absolute value:

>> plot((diametros-diametros_opt),longitudes,’.’)

More positive deviations than negative. We see this better with the histogram:

>> hist(diametros-diametros_opt,20)
>> xlabel(‘Deviation (\mum)’)

This agrees with the shape of the cost, which is much steeper in for negative deviations.

We compute the metric, which takes into account both the effect associated to length, and the effect associated to the sign.

>> [m,coste_real,coste_perm,errormedio]=metrica_branching_02(diametros,bifurcaciones,longitudes,10^5,3,1);
>> m
m =
0.0291
>> hist(coste_perm,200)
>> hold on
>> ejes=axis;
>> axis(axis)
>> plot(coste_real*[1 1],ejes(3:4),’r’)

I’d say it is as good as was to be expected, taking into account the small amount of data that we have.

THE SAME, BUT OPTIMIZING THE CHILDREN:

Surprisingly, it works worse:

>> diametros_opt=secundarios_opt(diametros,bifurcaciones,3);
>> plot(abs(diametros-diametros_opt),longitudes,’.’)

This looks reasonable, and the three possible outlayers may be compensated by the better statistics. But the sign of the deviations does not help here:

>> plot((diametros-diametros_opt),longitudes,’.’)

>> hist(diametros-diametros_opt,20)

Deviations are mostly negative. Now I see that this had to happen: If the mother is too thick (positive deviation) then the children are too thin (negative deviation).

The metric is not so good as in the other case:
>> [m,coste_real,coste_perm,errormedio]=metrica_branching_02(diametros,bifurcaciones,longitudes,10^5,3,2);
>> m
m =
0.0671

I compute the metric again, but using the old program, which does not take into account the sign of the deviation (or at least not fully, because it keeps the sign of deviations, only randomizing the order. Thus, in the permuted systems there are the same number of deviations of each sign, so we still have the bias).

>> [m,coste_real,coste_perm,errormedio]=metrica_branching_02_03ago09(diametros,bifurcaciones,longitudes,10^5,3,2);
>> m
m =
0.0097

Results improve, being better than those got for the mothers (probably due to the better statistics).

## Second exploration of phase transitions: Transitions due to alternate optima

>> x=-1:.00001:1;
>> coste=(abs(x-.5)).^.5+.7*(abs(x+.6)).^.5;
>> plot(x,coste)

>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);

Apparently, no effect with just a change in the slope:

>> coste=(abs(x-.5)).^1+.7*(abs(x+.6)).^1;
>> plot(x,coste)

>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);

## First exploration of phase transitions: Fake transitions due to the binning.

I study the specific heat without doing the simulated annealing. I just assume one state per bin, and compute the probability as exp(-cost/temperature) for each state. Then the specific heat is the variance of the cost divided by the square of the temperature.

It seems that the binning may produce fake phase transitions near zero temperature, when the cost is narrow near the minimum:

Quadratic cost, and no fake phase transition despite the coarse binning:

>> x=-1:.01:1;
>> coste=(abs(x)).^2;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 1],1);

Linear cost, and the fake phase transition appears:

>> coste=(abs(x)).^1;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);

Much more evident for sublinear cost:

>> coste=(abs(x)).^.5;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);

If I make a tighter binning, the maximum changes a lot (it even disappears if the binning is tight enough):

>> x=-1:.00001:1;
>> coste=(abs(x)).^.5;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);