| theta.tree {pegas} | R Documentation |
This function estimates the population parameter THETA from a genealogy (coded a as phylogenetic tree) under the coalescent.
theta.tree(phy, theta, fixed = FALSE, log = TRUE)
phy |
an object of class "phylo". |
theta |
a numeric vector. |
fixed |
a logical specifying whether to estimate theta
(the default), or to return the likelihoods for all values in
theta. |
log |
a logical specifying whether to return the likelihoods on a
log scale (the default); ignored if fixed = FALSE. |
The tree phy is considered as a genealogy, and therefore should
be ultrametric. By default, THETA is estimated by
maximum likelihood and the value given in theta is used as
starting value for the minimisation function (if several values are
given as a vector the first one is used). If fixed = TRUE,
then the [log-]likelihood values are returned corresponding to each
value in theta.
If fixed = FALSE, a list with two elements:
theta |
the maximum likelihood estimate of THETA; |
logLik |
the log-likelihood at its maximum. |
If fixed = TRUE, a numeric vector with the [log-]likelihood
values.
Emmanuel Paradis
Kingman, J. F. C. (1982) The coalescent. Stochastic Processes and their Applications, 13, 235–248.
Wakeley, J. (2009) Coalescent Theory: An Introduction. Greenwood Village, CO: Roberts and Company Publishers.
tr <- rcoal(50) # assumes theta = 1 theta.tree(tr, 10) ## profile log-likelihood: THETA <- seq(0.5, 1.5, 0.01) logLikelihood <- theta.tree(tr, THETA, fixed = TRUE) plot(THETA, logLikelihood, type = "l")