Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pml.fit

Internal maximum likelihood functions.


Description

These functions are internally used for the likelihood computations in pml or optim.pml.

Usage

lli(data, tree = NULL, ...)

edQt(Q = c(1, 1, 1, 1, 1, 1), bf = c(0.25, 0.25, 0.25, 0.25))

pml.free()

pml.init(data, k = 1L)

pml.fit(tree, data, bf = rep(1/length(levels), length(levels)), shape = 1,
  k = 1, Q = rep(1, length(levels) * (length(levels) - 1)/2),
  levels = attr(data, "levels"), inv = 0, rate = 1, g = NULL,
  w = NULL, eig = NULL, INV = NULL, ll.0 = NULL, llMix = NULL,
  wMix = 0, ..., site = FALSE, Mkv = FALSE, site.rate = "gamma")

Arguments

data

An alignment, object of class phyDat.

tree

A phylogenetic tree, object of class phylo.

...

Further arguments passed to or from other methods.

Q

A vector containing the lower triangular part of the rate matrix.

bf

Base frequencies.

k

Number of intervals of the discrete gamma distribution.

shape

Shape parameter of the gamma distribution.

levels

The alphabet used e.g. c("a", "c", "g", "t") for DNA

inv

Proportion of invariable sites.

rate

Rate.

g

vector of quantiles (default is NULL)

w

vector of probabilities (default is NULL)

eig

Eigenvalue decomposition of Q

INV

Sparse representation of invariant sites

ll.0

default is NULL

llMix

default is NULL

wMix

default is NULL

site

return the log-likelihood or vector of sitewise likelihood values

Mkv

indicate if Lewis' Mkv should be estimated.

site.rate

Indicates what type of gamma distribution to use. Options are "gamma" approach of Yang 1994 (default), "quadrature" after the Laguerre quadrature approach of Felsenstein 2001.

Details

These functions are exported to be used in different packages so far only in the package coalescentMCMC, but are not intended for end user. Most of the functions call C code and are far less forgiving if the import is not what they expect than pml.

Value

pml.fit returns the log-likelihood.

Author(s)

References

Felsenstein, J. (1981) Evolutionary trees from DNA sequences: a maximum likelihood approach. Journal of Molecular Evolution, 17, 368–376.

See Also


phangorn

Phylogenetic Reconstruction and Analysis

v2.7.0
GPL (>= 2)
Authors
Klaus Schliep [aut, cre] (<https://orcid.org/0000-0003-2941-0161>), Emmanuel Paradis [aut] (<https://orcid.org/0000-0003-3092-2199>), Leonardo de Oliveira Martins [aut] (<https://orcid.org/0000-0001-5247-1320>), Alastair Potts [aut], Tim W. White [aut], Cyrill Stachniss [ctb], Michelle Kendall [ctb], Keren Halabi [ctb], Richel Bilderbeek [ctb], Kristin Winchell [ctb], Liam Revell [ctb], Mike Gilchrist [ctb], Jeremy Beaulieu [ctb], Brian O'Meara [ctb], Long Qu [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.