Search code examples
matlabmachine-learningsequencepredictionhidden-markov-models

sequence prediction using HMM Matlab


I'm currently learning the murphyk's toolbox for Hidden Markov's Model, However I'v a problem of determining my model's coefficients and also the algorithm for the sequence prediction by log likelihood.

My Scenario:

I have the flying bird's trajectory in 3D-space i.e its X,Y and Z which lies in Continuous HMM's category. I'v the 200 observations of flying bird i.e 500 rows data of trajectory, and I want to predict the sequence. I want to sample that in 20 datapoints . i.e after 10 points, so my first question is, Is following parameters are valid for my case?

  O = 3;  %Number of coefficients in a vector 
  T = 20; %Number of vectors in a sequence 
  nex = 50; %Number of sequences 
  M = 2;  %Number of mixtures 
  Q = 20; %Number of states 

And the second question is, What algorithm is appropriate for sequence prediction and is training is compulsory for that?


Solution

  • From what I understand, I'm assuming you're training 200 different classes (HMMs) and each class has 500 training examples (observation sequences).

    O is the dimensionality of vectors, seems to be correct.

    There is no need to have a fixed T, it depends on the observation sequences you have.

    M is the number of multivariate Gaussians (or mixtures) in the GMM of a state. More will fit to your data better and give you better accuracy, but at the cost of performance. Choose a suitable value.

    N does not need to be equal to T. For the best number of states N, you'll have to benchmark and see yourself:

    Determinig the number of hidden states in a Hidden Markov Model

    Yes, you have to train your classes using the Baum-Welch algorithm, optionally preceded by something like the segmental k-means procedure. After that you can easily perform isolated unit recognition using Forward/Backward probability or Viterbi probability by simply selecting the class with the highest probability.