Learn R Programming

ouch (version 1.0-3)

hansen.fit: Hansen model of evolution along a phylogenetic tree

Description

These functions relate to the Hansen model for phylogenetic evolution. hansen.fit{fits the parameters alpha, sigma, and theta of this model.} hansen.dev{generates random deviates from the Hansen model.}

Usage

hansen.fit(data, topology, times, regimes,
           guess = 0, interval = c(0.001, 20), tol = 1e-12)
hansen.dev(n = 1, topology, times, regimes, alpha, sigma, theta)

Arguments

data
Phenotypic data for extant species, i.e., at the terminal ends of the phylogenetic tree.
topology
Specification of the topology of the phylogenetic tree. This is in the form of a vector of nonnegative integers, one for each node in the tree. The i-th number is that of the ancestor of the i-th node. The root node is distinguished by the number
times
A vector of nonnegative numbers, one per node in the tree, specifying the time at which each node is located. The root node should be assigned time 0.
regimes
A vector of codes, one for each node in the tree, specifying the selective regimes hypothesized to have been operative. Corresponding to each node, enter the code of the regime hypothesized for the branch segment terminating in that node. For the
guess
(Optional). An initial guess for the selection strength parameter alpha. This is used to initialize the optimization algorithm.
interval
The interval which will be searched for the optimal alpha. By default, 0.001 < alpha < 20.
tol
Convergence tolerance.
n
Number of pseudorandom data sets to generate.
alpha
Value of alpha to use.
sigma
Value of sigma to use.
theta
Value of theta to use.

Value

  • hansen.fit returns a list containing the following elements:
  • alphaMaximum likelihood estimate of alpha. Note that if alpha lies against one of the constraints (see interval above), then this is not a maximum-likelihood estimate.
  • sigmaMaximum likelihood estimate of sigma.
  • thetaMaximum likelihood estimate of theta.
  • u-2 log likelihood.
  • aicAkaike information criterion.
  • sicSchwartz information criterion (=BIC)
  • dfNumber of parameters estimated (= 3 + number of regimes).
  • hansen.dev returns a data frame containing simulated data sets. Each realization is a row.

References

Butler, M.A. and A.A. King (2004) Phylogenetic comparative analysis: a modeling approach for adaptive evolution. American Naturalist, in press.