training hmm on HMM.R