61 for(
size_t i = 0; i < nSites; i++)
63 VVdouble * postProb_i = & postProb[i];
64 postProb_i->resize(nClasses);
65 Vdouble * larray_i = & larray[i];
66 for(
size_t c = 0; c < nClasses; c++)
68 Vdouble * postProb_i_c = & (* postProb_i)[c];
69 postProb_i_c->resize(nStates);
70 double * rcProb = & rcProbs[c];
71 for(
size_t x = 0; x < nStates; x++)
73 (* postProb_i_c)[x] = (* larray_i)[x] * (* rcProb);
84 for(
size_t i = 0; i < nSites; i++)
87 for(
size_t c = 0; c < nClasses; c++)
89 Vdouble * larray_i_c = & (* larray_i)[c];
90 for(
size_t s = 0; s < nStates; s++)
92 likelihoods[i] += (* larray_i_c)[s];
97 for(
size_t i = 0; i < nSites; i++)
99 VVdouble * postProb_i = & postProb[i];
100 postProb_i->resize(nClasses);
102 double likelihood = likelihoods[i];
103 for(
size_t c = 0; c < nClasses; c++)
105 Vdouble * postProb_i_c = & (* postProb_i)[c];
106 postProb_i_c->resize(nStates);
107 Vdouble * larray_i_c = & (* larray_i)[c];
108 for(
size_t x = 0; x < nStates; x++)
110 (* postProb_i_c)[x] = (* larray_i_c)[x] / likelihood;
127 for (
size_t i = 0; i < probs.size(); i++)
135 freqs[k] += probs[i][j][k] * w;