// Metroplis or greedy step; if trial clustering accepted, then update current <-- trial
if(trialLL > bestLL){
bestACounts = trialACounts;
bestClusterInds = trialClusterInds;
bestLabelVec = trialLabelVec;
bestLL = trialLL;
}
}
// Keep track of best clustering overall
if (bestLL > oldbestLL){// replace and save if trialLL is an improvement
oldbestLL = bestLL;
bestCount++;
}
old code