Commit 0ebd9bb4 authored by Milad Malekzadeh's avatar Milad Malekzadeh

Test tab correction.

parent bc2e5a26
......@@ -9,14 +9,14 @@ MuTmp = zeros(nbVarOut,model.nbStates);
expData = zeros(nbVarOut,nbData);
expSigma = zeros(nbVarOut,nbVarOut,nbData);
for t=1:nbData
%Compute activation weight
%See Eq. (3.0.5) in doc/TechnicalReport.pdf
for i=1:model.nbStates
H(i,t) = model.Priors(i) * gaussPDF(DataIn(:,t), model.Mu(in,i), model.Sigma(in,in,i));
end
H(:,t) = H(:,t)/sum(H(:,t));
%Compute expected conditional means
%See Eq. (3.0.3) in doc/TechnicalReport.pdf
%Compute activation weight
%See Eq. (3.0.5) in doc/TechnicalReport.pdf
for i=1:model.nbStates
H(i,t) = model.Priors(i) * gaussPDF(DataIn(:,t), model.Mu(in,i), model.Sigma(in,in,i));
end
H(:,t) = H(:,t)/sum(H(:,t));
%Compute expected conditional means
%See Eq. (3.0.3) in doc/TechnicalReport.pdf
for i=1:model.nbStates
MuTmp(:,i) = model.Mu(out,i) + model.Sigma(out,in,i)/model.Sigma(in,in,i) * (DataIn(:,t)-model.Mu(in,i));
expData(:,t) = expData(:,t) + H(i,t) * MuTmp(:,i);
......@@ -26,9 +26,9 @@ for t=1:nbData
for i=1:model.nbStates
SigmaTmp = model.Sigma(out,out,i) - model.Sigma(out,in,i)/model.Sigma(in,in,i) * model.Sigma(in,out,i);
expSigma(:,:,t) = expSigma(:,:,t) + H(i,t) * (SigmaTmp + MuTmp(:,i)*MuTmp(:,i)');
for j=1:model.nbStates
expSigma(:,:,t) = expSigma(:,:,t) - H(i,t)*H(j,t) * (MuTmp(:,i)*MuTmp(:,j)');
end
for j=1:model.nbStates
expSigma(:,:,t) = expSigma(:,:,t) - H(i,t)*H(j,t) * (MuTmp(:,i)*MuTmp(:,j)');
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment