forward and backward procedure of the Baum-Welch