Added setting of the initial parameter value to the one corresponding to the largest gap between two consecutive gain or loss values