Parameter estimation in HMMs with guaranteed convergence