⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hmminitvit.m

📁 Mathematical Methods by Moor n Stiling.
💻 M
字号:
function hmminitvit(inHMM,inpathlen)
% 
% Initialize the Viterbi algorithm stuff for HMM sequence identification
%
% function hmminitvit(inHMM,inpathlen)
% 
% inHMM = a structure containing the initial probabilities, state transition
%         probabilities, and output probabilities
% inpathlen = length of window used in VA

% Copyright 1999 by Todd K. Moon

global vHMM;                     % used in computation of branch weights
global pathcost;                 % the pathcost for the VA
vHMM = inHMM;
[nstate,nstate] = size(vHMM.A);
nlist = zeros(1,nstate);     bigno = realmax;
 
for i=1:nstate                   % "from" state
  Atrellis{i} = [];
  k = 0;
  for j=1:nstate                 % "to" state
    if vHMM.A(j,i)
      k = k+1;
      Atrellis{i} = [Atrellis{i} j];
      hmmbranchweight{i,k} = [ -log(vHMM.A(j,i))];
    end
  end
end
% Now initialize the Viterbi algorithm stuff
initvit1(Atrellis,hmmbranchweight, inpathlen, 'hmmnorm');
% set up the initial path costs
idx = find(vHMM.pi ~= 0);
pathcost(idx) = -log(vHMM.pi(idx));     % valid starting paths
idx = find(vHMM.pi == 0);
pathcost(idx) = realmax;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -