This code duplicates the functionality of the program Tip.Dates (see references).
The dates of the internal nodes of 't' are estimated using a maximum likelihood
approach. 't' must be rooted and have branch lengths in units of expected substitutions per
site.
'node.dates' can be either a numeric vector of dates for the tips or a numeric
vector for all of the nodes of 't'. 'estimate.mu' will use all of the values
given in 'node.dates' to estimate the mutation rate. Dates can be censored with
NA. 'node.dates' must contain all of the tip dates when it is a parameter of
'estimate.dates'. If only tip dates are given, then 'estimate.dates' will run an
initial step to estimate the dates of the internal nodes. If 'node.dates'
contains dates for some of the nodes, 'estimate.dates' will use those dates as
priors in the inital step. If all of the dates for nodes are given, then
'estimate.dates' will not run the inital step.
If 'is.binary' is set to FALSE, 'estimate.dates' uses the '"optimize"' function as
the optimization method. By default, R's '"optimize"' function uses a precision
of '".Machine$double.eps^0.25"', which is about 0.0001 on a 64-bit system. This
should be set to a smaller value if the branch lengths of 't' are very short. If
'is.binary' is set to TRUE, estimate dates uses calculus to deterimine the maximum
likelihood at each step, which is faster. The bounds of permissible values are
reduced by 'opt.tol'.
'estimate.dates' has several criteria to decide how many steps it will run. If
'lik.tol' and 'nsteps' are both 0, then 'estimate.dates' will only run the initial
step. If 'lik.tol' is greater than 0 and 'nsteps' is 0, then 'estimate.dates'
will run until the difference between successive steps is less than 'lik.tol'. If
'lik.tol' is 0 and 'nsteps' is greater than 0, then 'estimate.dates' will run the
inital step and then 'nsteps' steps. If 'lik.tol' and 'nsteps' are both greater
than 0, then 'estimate.dates' will run the inital step and then either 'nsteps'
steps or until the difference between successive steps is less than 'lik.tol'.