Parameter estimation and prediction for hidden Markov and