// $Id: bestAlphaManyTrees.cpp 962 2006-11-07 15:13:34Z privmane $ // version 1.00 // last modified 3 Nov 2002 #include "bestAlphaManyTrees.h" #include "bestAlpha.h" #include "numRec.h" #include "bblEMProportional.h" #include "bblEMSeperate.h" #include "logFile.h" #include using namespace std; #ifndef VERBOS #define VERBOS #endif void bestAlpha::optimizeAlphaNG_EM_PROP(tree& et, vector& sc, vector& sp, const vector * weights, MDOUBLE & bestAlpha, MDOUBLE & likelihoodScore, const int maxIterations, const MDOUBLE epsilon){ //LOG(5,<<" 1. bestAlpha::findBestAlpha"<& et, vector& pi, const VVdouble * weights) { //LOG(5,<<" 1. bestAlpha::findBestAlpha"<& et, vector& sc, vector& sp, const vector * weights, MDOUBLE & bestAlpha, MDOUBLE & likelihoodScore, const int maxIterations, const MDOUBLE epsilon) { // SEPERATE ANALYSIS, 1 GAMMA //LOG(5,<<" 1. bestAlpha::findBestAlpha"<& sc, vector& sp, const vector * weights, vector & bestAlphas, MDOUBLE & likelihoodScore, const int maxIterations, const MDOUBLE epsilon){ //LOG(5,<<" 1. bestAlpha::findBestAlpha"< bestAs= bestAlphas; vector newAlphas(sc.size(),0); int i; const int maxIterationsThisF = 50; for (i=0; i < maxIterationsThisF; ++i) { #ifdef VERBOS LOG(5,<<" ============================ optimizing bbl (fixed alphas) ================= \n"); #endif newL=0; bblEMProportional bblem1(et,sc,sp,weights,maxIterations,epsilon); MDOUBLE tmpX =bblem1.getTreeLikelihood(); #ifdef VERBOS LOG(5,<<"likelihood of trees (sum)= "<