1 function max_likelihood_clusters = get_max_clusters(X, model)
\r
3 % Compute the max likelihood clusters for each observation
\r
4 for i=1:size(X.obs, 2)
\r
7 probs = zeros(1, model.num_mcs);
\r
9 for j=1:model.num_mcs
\r
10 chain_prob = chain_likelihood(obs, model.chain(j));
\r
11 probs(j) = chain_prob;
\r
12 if (best_chain == -1 | best_likelihood < chain_prob)
\r
13 best_likelihood = chain_prob;
\r
17 max_likelihood_clusters(i).best_cluster = best_chain;
\r
18 max_likelihood_clusters(i).best_probs = best_likelihood;
\r
19 max_likelihood_clusters(i).probs = probs;
\r