TP-traitement-audio-visuel/TP3/probabilites_EM.m

17 lines
439 B
Mathematica
Raw Permalink Normal View History

2023-06-22 18:47:16 +00:00
function probas = probabilites_EM(D_app, parametres_estim, proportion_1, proportion_2, sigma)
pi_vec = [proportion_1 proportion_2];
sigma_vec = [sigma sigma];
bidule = @(k) pi_vec(k) / sigma_vec(k) .* exp( - calcul_r(D_app, parametres_estim(k, :)).^2 ./ 2 ./ sigma_vec(k) );
probas = zeros(length(D_app), 2);
for k=1:2
probas(:,k) = bidule(k) ./ (bidule(1) + bidule(2));
end
probas = probas';
end