Help for multiple sequences for hmmtrain

5 visualizaciones (últimos 30 días)
Tiago
Tiago el 13 de Sept. de 2014
Respondida: Abhas el 5 de Jun. de 2025
Hello
I try to use HMM for predict degradation but i have problem to understand how use hmmtrain for more than one sequences
Thanks for the help

Respuestas (1)

Abhas
Abhas el 5 de Jun. de 2025
Hi @Tiago,
To train a Hidden Markov Model (HMM) using multiple observation sequences in MATLAB, you can utilize the "hmmtrain" function by providing your sequences in specific formats. This approach is beneficial when modeling processes like degradation over time.
The "hmmtrain" function supports multiple sequences in the following formats:
  • Matrix Format: Each row represents a separate sequence.
seq = [
1 2 3 2 1;
2 3 1 2 3;
3 1 2 3 1
];
  • Cell Array Format: Each cell contains a sequence vector.
seq = {
[1 2 3 2 1],
[2 3 1 2 3],
[3 1 2 3 1]
};
Both formats are acceptable for "hmmtrain". Ensure that your initial estimates for the transition ("TRGUESS") and emission ("EMITGUESS") probability matrices are appropriately defined.
Here's an example code:
% Define multiple sequences
seq = {
[1 2 3 2 1],
[2 3 1 2 3],
[3 1 2 3 1]
};
% Initial guesses for transition and emission matrices
TRGUESS = rand(3);
EMITGUESS = rand(3, 3);
% Train HMM
[ESTTR, ESTEMIT] = hmmtrain(seq, TRGUESS, EMITGUESS);
You may refer to the below documentation links to know more about the same:
I hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by