get_agg_opt function

Runs the EM algorithm over all possible group aggregating , returning the one with higher likelihood while constraining the standard deviation of the probabilities.