Skip to content

Commit

Permalink
tweak logKde
Browse files Browse the repository at this point in the history
  • Loading branch information
sth4nth committed Mar 11, 2017
1 parent be1bbc3 commit 7c97784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter02/logKde.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
% Output:
% z: probability density in logrithm scale z=log p(x|y)
% Written by Mo Chen ([email protected]).
D = bsxfun(@plus,full(dot(X,X,1)),full(dot(Y,Y,1))')-full(2*(Y'*X));
D = dot(X,X,1)+dot(Y,Y,1)'-2*(Y'*X);
z = logsumexp(D/(-2*sigma^2),1)-0.5*log(2*pi)-log(sigma*size(Y,2),1);

0 comments on commit 7c97784

Please sign in to comment.