hmm function

Fit hidden Markov and latent class models.