hmmtrain.m with unknown state sequence (Baum-Welch)
Ältere Kommentare anzeigen
I have a vector of observations Y. I do not know the state sequence of the latents. I wish to find the the transistion and emission matrices hence I want Baum-Welch.
My Min Working example is here:
T = 1000; % Number of timesteps
Y= 1000+cumsum(randn(T,1));
K = 200; %number of states
beta = 0.5;
TRGUESS = get_stateTransitionMatrix(K, beta); %flat start model
N = 2;
EMITGUESS = (1/N) .* ones(K,N);
[TRANS,EMIS] = hmmtrain(Y,TRGUESS,EMITGUESS);
function TRGUESS = get_stateTransitionMatrix(K, beta)
TRGUESS = beta.*eye(K,K);
for i=1:K
for j=1:K
if (TRGUESS(i,j)==0)
TRGUESS(i,j) = (1-beta)/(K-1);
end
end
end
end
On running this I get:
Error using hmmdecode (line 100)
SEQ must consist of integers between 1 and 1.
Error in hmmtrain (line 213)
[~,logPseq,fs,bs,scale] = hmmdecode(seq,guessTR,guessE);
I fear I have misunderstood the hmmtrain documentation. Can anyone help?
thanks!
(using 2012A and all the toolboxes)
1 Kommentar
Matlab2010
am 14 Nov. 2012
Akzeptierte Antwort
Weitere Antworten (2)
imene s
am 18 Mär. 2015
0 Stimmen
please i need this fuction hmmtrain
1 Kommentar
Sean de Wolski
am 19 Mär. 2015
amani
am 18 Jun. 2015
0 Stimmen
Any thoughts about the default prior vector (pi) used in hmmtrain.m ??
Kategorien
Mehr zu Mathematics and Optimization finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!