Skip to content

Commit

Permalink
Bugfix E-step math error
Browse files Browse the repository at this point in the history
Commit 41f1090a was based around a mistaken claim that
    log(det(X)) = sum(log(diag(chol(X))))
but actually this is missing a factor of 2 because the Cholesky
decomposition is a sort of square root. So in reality it should be
    log(det(X)) = 2 * sum(log(diag(chol(X))))
and this commit incorporates that factor of 2.
  • Loading branch information
kqshan committed Aug 19, 2019
1 parent 9849821 commit 0487f04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion @MoDT/Estep.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
% Mahalanobis distance is cached from the M-step
delta = self.mahal_dist;
for k = 1:K
logSqrtDetC(k) = sum(log(diag(chol(self.C(:,:,k))))) / 2;
logSqrtDetC(k) = sum(log(diag(chol(self.C(:,:,k)))));
end
end

Expand Down

0 comments on commit 0487f04

Please sign in to comment.