compute_betas_from_shifts function

Computation of the optimal values at nodes and tips.