From faff252cf7b2480d99d146d1af7a10524cd88967 Mon Sep 17 00:00:00 2001 From: Thomas Wong Date: Wed, 17 Jun 2026 14:57:34 +1000 Subject: [PATCH] Fix EM mixture-freq: clear stale partial lh in E-step --- model/modelmixture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/modelmixture.cpp b/model/modelmixture.cpp index 6ee1fb06..dab09e7d 100644 --- a/model/modelmixture.cpp +++ b/model/modelmixture.cpp @@ -4177,6 +4177,7 @@ double ModelMixture::optimizeWithEM(double gradient_epsilon) { // EM algorithm loop described in Wang, Li, Susko, and Roger (2008) for (step = 0; step < optimize_steps; step++) { // first compute _pattern_lh_cat + phylo_tree->clearAllPartialLH(); score = phylo_tree->computePatternLhCat(WSL_MIXTURE); if (score < prev_score + gradient_epsilon) @@ -4254,6 +4255,7 @@ double ModelMixture::optimizeWithEM(double gradient_epsilon) { if (c>0 && !Params::getInstance().optimize_linked_gtr) { // compute _pattern_lh_cat + phylo_tree->clearAllPartialLH(); phylo_tree->computePatternLhCat(WSL_MIXTURE); // update the posterior probabilities of each category for (ptn = 0; ptn < nptn; ptn++) {