Hidden Markov Model Forward Algorithm