Hello Eliot,
Branch lengths are measured in units of expected number of substitutions. The parameter mu is different from the branch length reported in HyPhy because the latter is scaled by the expected number of substitutions, calculated by summing the rates of all possible substitutions (all parameters in the off-diagonal of the rate matrix).
In order to see this, try the following example code:
Code:DataSet nucleotideSequences = ReadDataFile ("data/3.seq");
DataSetFilter filteredData = CreateFilter (nucleotideSequences,1);
HarvestFrequencies (observedFreqs, filteredData, 1, 1, 1);
F81RateMatrix =
{{*,mu,mu,mu}
{mu,*,mu,mu}
{mu,mu,*,mu}
{mu,mu,mu,*}};
Model F81 = (F81RateMatrix, observedFreqs);
ALLOW_SEQUENCE_MISMATCH = 1;
Tree threeTaxaTree = (a,b,c);
LikelihoodFunction theLnLik = (filteredData, threeTaxaTree);
Optimize (paramValues, theLnLik);
unconstrainedLnLik = paramValues[1][0];
fprintf (stdout, "\n0).UNCONSTRAINED MODEL:", theLnLik);
fprintf (stdout, "\n", observedFreqs, "\n");
/*_____________________________________________________________________ */
function computeScalingFactorB(rateMatrix, baseFreqs)
{
B = 0;
for (n1 = 0; n1 < Rows(rateMatrix); n1 = n1+1)
{
for (n2 = 0; n2 < Columns(rateMatrix); n2 = n2+1)
{
if (n2 != n1)
{
B = B + baseFreqs[n1]*baseFreqs[n2]*rateMatrix[n1][n2];
}
}
}
return B;
}
fprintf (stdout, "scaling factor = ", computeScalingFactorB (F81RateMatrix, observedFreqs), "\n");
Hope this helps,
- Art.