Maximum likelihood (ML) is based upon calculating the probability of observ=
ed data given a hypothesis. The alternative hypotheses in phylogenetic infe=
rence are all the various trees that can be drawn for a set of taxa. In an =
ML search, we aim to find the tree that, given our evolutionary model, resu=
lts in the highest likelihood of obtaining the data we observe. Thus, we ar=
e maximizing the likelihood of the data under the model for evolution that =
we choose, which is covered in more detail in
Section 2.5.

ML is a different approach=
to tree inference than parsimony, but there are important similarities. Fo=
r example, both ML and parsimony search tree space in similar ways. When tr=
ees become large, one must often devise a strategy for sampling a subset of=
all possible trees, because no computer is fast enough to sample the huge =
number of possible trees, which increase exponentially as a function of num=
ber of taxa. In addition, ML shares with parsimony the goal of finding the =
"best" tree topology. The difference is that, rather than finding the tree =
that minimizes the number of inferred changes, ML finds the tree that maxim=
izes the likelihood of the data.

That sounds confusing at first, but can be understood if you consider that =
simply counting changes fails to make use of all the information available.=
For example, the parsimony method effectively assumes that the probability=
of a change happening is the same regardless of how long ago two taxa dive=
rged. This, of course, is an unrealistic assumption, because taxa that dive=
rged in the more distant past have had more time for evolutionary changes t=
o take place, assuming there is a roughly constant probability of change ov=
er time. ML uses an explicit probability model that can effectively account=
for the greater number of evolutionary changes that are expected on long b=
ranches relative to short ones (see
Section 2.5).

In later sections, we will use=
R and other programs to select a model of evolution, and as part of that p=
rocess, we will infer a phylogeny using maximum likelihood. Before proceedi=
ng, however, it is worth noting that the R package 'phangorn', which was us=
ed in the previous two sections, provides some simple tools to compare the =
likelihood of the data under different models of evolution or among differe=
nt phylogenies. Keep in m=
ind that we are using a small dataset of just 150 nucleotides, and this is =
not meant to be a definitive analysis. Rather, this example simply illustra=
tes that many fundamental steps of a maximum likelihood analysis can be con=
ducted easily in R. First=
, load the two packages we will need for this section (see subsection 1.1.3 for instructions on installing pack=
ages):

library("phangorn")

The phangorn function 'pml' pr=
ovides a way to compute the likelihood of the data given a phylogenetic tre=
e and evolutionary model. Drawing on the trees obtained in Section 2.2, let=
's do some simple likelihood computations (you will need to first complete&=
nbsp;Section 2.2 to run these analyses).

fit_treeUPGMA =3D pml(unroot(treeUPGMA), data=3Dprimates)

Type 'fit_treeUPGMA' to obtain=
the key statistics, such as the likelihood and the transition matrix that =
is assumed, and 'summary(fit_treeUPGMA)' to see the output format of type '=
pml'. We can then optimize the branch lengths under this simple model of ev=
olution (the Jukes-Cantor model, where all changes are equally likely), and=
compare the two trees graphically:

fit_treeUPGMA_opt1 =3D optim.pml(fit_treeUPGMA) layout(matrix(c(1,2)), height=3Dc(1,1)) par(mar =3D c(.1,.1,.1,.1)) plot(fit_treeUPGMA, main=3D"default branches", cex =3D 0.8) # top =3D def= ault branch lengths plot(fit_treeUPGMA_opt1, main=3D"optimized branches", cex =3D 0.8) # bott= om =3D optimized branch lengths

In the graphics window, the tree o= n top shows the default branches, while the tree on the bottom shows the br= anches after optimization. Longer branches indicate that more molecular cha= nge has occurred along a given branch. You will find that the likelihood of= the data under optimized branch lengths has increased considerably - from = 1573.4 to 1555. We can compare these models using the 'AIC' function and we= find unsurprisingly that the AIC is substantially lower for the tree with = branches optimized.

AIC(fit_treeUPGMA, fit_treeUPGMA_opt1)

We can also search for a bette=
r tree by re-arranging the branches, i.e., by setting the parameter 'optNni=
' to 'TRUE', which causes the function 'optim.pml' to optimize tree topolog=
y in addition to branch lengths:

fit_treeUPGMA_opt2 =3D optim.pml(fit_treeUPGMA, optNni=3DTRUE)

= layout(matrix(c(1,2)), height=3Dc(1,1))

plot(fit_treeUPGMA_opt1, cex= =3D 0.8) # top =3D original topology with optimized branch lengths

plot(fit_treeUPGMA_opt2, cex =3D 0.8) # bottom =3D optimized topology A= ND branch lengths

AIC(fit_treeUPGMA_opt1, fit_treeUPGMA_opt2)

This slightly revised tree drops the AIC almost 10 points, indicating be= tter fit. Many other functions can be used to further optimize parameters o= f the evolutionary model, the tree, or to test alternative models of evolut= ion (e.g. a generalized time reversible model). In the following section, w= e further explore model selection using R in combination with another progr= am called PHYLM.

Bolker, B., and R Development Core Team (2011). bbmle: Tools for general ma= ximum likelihood estimation. R package version 0.9.7. http://CRAN.R-project.org/package=3Dbbmle

Felsenstein J. 2004.Inferring Phylogenies. Sunderland MA: Sinauer Associates.

Hodgson, J. A., K. N. Sterner, L. J. Matthews, A. S. Burrell, R. L. Raaum, = C. B. Stewart, and T. R. Disotell. 2009. Successive radiations, not stasis,= in the South American primate fauna.Proceedings of the National Academy of Sciences, USA. 106:5534-553= 9.

R Development Core Team (2010). R: A language and environment for statistic= al computing. R Foundation for

Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL http://www.R-project.org.

Schliep, K. 2010. phangorn: Phylogenetic analysis in R. R package version 1= .2-0.