How can I create a Hidden Markov Model (HMM) out of continuous Input and discrete Output?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to create a Hidden Markov Model. I am trying to use the HMM Toolbox from Kevin Murphy. Right now I am struggling with the first steps. My Input is 140 Observations of an acceleration signal with different length each. My Output is a discrete rating of performance from 1 to 7. It means I have 1 rating for every Observation.
How can I choose the number of States Q and the number O of Output Symbols? Would that mean Q=140 and O=7?
How do I get my signals into the model?
0 comentarios
Respuestas (1)
Carl
el 8 de Feb. de 2017
Editada: Carl
el 8 de Feb. de 2017
See the guide here if you haven't done so already:
https://www.cs.ubc.ca/~murphyk/Software/HMM/hmm_usage.html
In the example, they use Q = the number of states, and O = the number of output symbols. You will have to bin your continuous signal values into a discrete set of states. For example, if your signal can take a value between 0 and 1, you can can bin this into 10 different states (0.0 to 0.1, 0.1 to 0.2, etc.). You can then set Q = the number of states you have defined, and O = 7.
In general, HMMs do not support continuous states, as they have to maintain state transition and output probabilities. If you would like a more robust way of binning your continuous values into a discrete space, look at the following Answers post. The code uses quantization to bin continuous observations, but you can generalize the solution to bin any type of data.
Also, I would suggest looking up the structure of HMMs in general. Rather than the concept of inputs and outputs, it operates on the concept of hidden internal states and observed outputs. It may be that you have your states and outputs mixed up; do you "observe" the signal, or the performance rating? What is the internal state?
2 comentarios
Carl
el 9 de Feb. de 2017
To answer your first question: both. The variables prior0, transmat0, and obsmat0 are randomized and used to generate the training data. Therefore, the data that they're using is random. The variables prior1, transmat1, and obsmat1 are initialized to random values, and then improved using the EM algorithm. These variables are the parameters of the HMM that is being trained.
Each state in a sequence should correspond with one observation. By the "number of states" or "number of observations", I actually mean the number of possible states or observations. So in your case you would have multiple possible values for both the signal and the rating.
This really depends on how you would like to work with your data. Generally, HMMs are trained only on sequences of observations. I would highly recommend reading more on HMMs, to better determine the best way of structuring this for your specific use case.
https://www.mathworks.com/help/stats/hidden-markov-models-hmm.html
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!