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

📄 hmmgausfupn.m

📁 Mathematical Methods by Moor n Stiling.
💻 M
字号:
function f = hmmgausfupn(y,alphahat,betahat,c,HMM)
% 
% Update the Gaussian output distribution f of the HMM using the normalized
% probabilities alphahat and betahat
%
% function f = hmmgausfupn(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);
[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,:)';
  mu = zeros(m,1);
  R = zeros(m,m);
  x = alphahatn(s,:).*betahat(s,:);
  for t=1:T
    mu = mu + x(t)*y(:,t);
% The following line is commented out in favor of its successor to attempt
% to stabilize the computations
%   R = R + x(t)*(y(:,t) - HMM.f{2,s})*(y(:,t) - HMM.f{2,s})';
    R = R + x(t)*diag((y(:,t) - HMM.f{2,s}).*(y(:,t) - HMM.f{2,s}));
  end
  f{2,s} = mu/d;
  f{3,s} = diag(diag(R))/d;
end

⌨️ 快捷键说明

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