hmmdiscfupn.m
来自「Mathematical Methods by Moor n Stiling.」· M 代码 · 共 30 行
M
30 行
function f = hmmdiscfupn(y,alphahat,betahat,c,HMM)
%
% Update the discrete HMM output distribution f using the normalized forward
% and backward probabilities alphahat and betahat
%
% function f = hmmdiscfupn(y,alphahat,betahat,c,HMM)
%
% y = output sequence
% alphahat = normalized alphas
% betahat = normalized betas
% c = normalization constants
% HMM = current model parameters
%
% f = updated output distribution
% Copyright 1999 by Todd K. Moon
[S,S] = size(HMM.A); [N,S] = size(HMM.f{2}); [m,T] = size(y);
f = HMM.f;
for t=1:T
alphahatn(:,t) = alphahat(:,t)/c(t);
end
for s=1:S
d = alphahatn(s,:) * betahat(s,:)';
for i = 1:N
idx = find(y==i);
f{2}(i,s) = sum(alphahatn(s,idx) .* betahat(s,idx))/d;
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?