This function allows you to perform the forward-backward algorithm for a Hidden Markov Model
forwardbackward(nStates, nu, A, B, bT)
an integer representing the number of state of the Hidden Markov Model.
a vector of the initial probabilities.
the transition matrix.
a matrix containing the values of the emission probabilities
the vector of the beginning times for the statistical units
The function returns a numeric value indicating the distance between the two curves.
Rabiner, L. R. (1989). A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2), 257-286.