Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Fixed the beta distribution in updatehyperpars.
  • Loading branch information
JohnAshburner committed Sep 21, 2020
1 parent 0c81787 commit 6293a9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spm_gmm_lib.m
Original file line number Diff line number Diff line change
Expand Up @@ -1502,12 +1502,12 @@
alpha0 = b0_priors{1};
beta0 = b0_priors{2};
b0(k) = 0;
alph = N*S;
bet = 1;
alph = 0.5*N*S+1;
bet = 0;
for s=1:S
[m,b,V,n] = get_posteriors(cluster,s);
m1 = m(:,k) - m0(:,k);
bet = bet + m1.' * (n(k)*V(:,:,k)) * m1 + N/b(k);
bet = bet + 0.5*(m1.' * (n(k)*V(:,:,k)) * m1 + N/b(k));
end
b0(k) = (alph+alpha0-1)/(bet+beta0);
% ---------------------------------------------------------------------
Expand Down

0 comments on commit 6293a9f

Please sign in to comment.