hansen.fit               package:ouch               R Documentation

_H_a_n_s_e_n _m_o_d_e_l _o_f _e_v_o_l_u_t_i_o_n _a_l_o_n_g _a _p_h_y_l_o_g_e_n_e_t_i_c _t_r_e_e

_D_e_s_c_r_i_p_t_i_o_n:

     These functions relate to the Hansen model for phylogenetic
     evolution.

_h_a_n_s_e_n._f_i_t fits the parameters alpha, sigma, and theta of this model.

_h_a_n_s_e_n._d_e_v generates random deviates from the Hansen model.

_U_s_a_g_e:

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

_A_r_g_u_m_e_n_t_s:

    data: Phenotypic data for extant species, i.e., at the terminal
          ends of the phylogenetic tree.

    node: Character vector of names of the nodes.

ancestor: Specification of the topology of the phylogenetic tree.  This
          is in the form of a character vector of node names, one for
          each node in the tree.  The i-th name is that of the ancestor
          of the i-th node.  The root node is distinguished by having
          no ancestor (i.e., NA).

   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 root node, because it has no branch segment
          terminating on it, the regime specification is irrelevant.

   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.

_V_a_l_u_e:

     hansen.fit returns a list containing the following elements: 

   alpha: Maximum 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.

   sigma: Maximum likelihood estimate of sigma.

   theta: Maximum likelihood estimate of theta.

       u: -2 log likelihood.

     aic: Akaike information criterion.

     sic: Schwartz information criterion (=BIC)

      df: Number of parameters estimated (= 3 + number of regimes).


     hansen.dev returns a data frame containing simulated data sets. 
     Each realization is a row.

_A_u_t_h_o_r(_s):

     Aaron A. King <king at tiem dot utk dot edu>

_R_e_f_e_r_e_n_c_e_s:

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

