17 lines
439 B
Mathematica
17 lines
439 B
Mathematica
|
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
|
||
|
|