11 lines
239 B
Matlab
11 lines
239 B
Matlab
function [LL] = Q_step(x, m, S, k, pi, h)
|
|
[num_data, ~] = size(x);
|
|
LL = 0;
|
|
for i = 1:k
|
|
N = mvnpdf(x, m(i, :), S(:, :, i));
|
|
for j = 1:num_data
|
|
LL = LL + h(j, i) * (log(pi(i) + eps) + log(N(j) + eps));
|
|
end
|
|
end
|
|
end
|
|
|