Skip to content

Commit

Permalink
simplified hmmRnd
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Jan 27, 2016
1 parent eb8410a commit c541508
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions chapter13/HMM/hmmRnd.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
E = normalize(rand(k,d),2);
s = normalize(rand(k,1),1);

z = zeros(1,n);
x = zeros(1,n);
z(1) = discreteRnd(s);
x(1) = discreteRnd(E(z(1),:));
z = discreteRnd(s);
x(1) = discreteRnd(E(z,:));
for i = 2:n
z(i) = discreteRnd(A(z(i-1),:));
x(i) = discreteRnd(E(z(i),:));
z = discreteRnd(A(z,:));
x(i) = discreteRnd(E(z,:));
end

model.A = A;
Expand Down

0 comments on commit c541508

Please sign in to comment.