From: paradis Date: Mon, 18 Mar 2013 10:51:36 +0000 (+0000) Subject: modified ace( method = ...) X-Git-Url: https://git.donarmstrong.com/?p=ape.git;a=commitdiff_plain;h=646d8be3497d656d95331e2c7f6bef5d2ff86b2c modified ace( method = ...) git-svn-id: https://svn.mpl.ird.fr/ape/dev/ape@211 6e262413-ae40-0410-9e79-b911bd7a66b7 --- diff --git a/R/ace.R b/R/ace.R index 2b9230e..b751c69 100644 --- a/R/ace.R +++ b/R/ace.R @@ -1,4 +1,4 @@ -## ace.R (2013-01-31) +## ace.R (2013-03-18) ## Ancestral Character Estimation @@ -19,10 +19,12 @@ se } -ace <- function(x, phy, type = "continuous", method = "ML", CI = TRUE, - model = if (type == "continuous") "BM" else "ER", - scaled = TRUE, kappa = 1, corStruct = NULL, ip = 0.1, - use.expm = FALSE) +ace <- + function(x, phy, type = "continuous", + method = if (type == "continuous") "REML" else "ML", + CI = TRUE, model = if (type == "continuous") "BM" else "ER", + scaled = TRUE, kappa = 1, corStruct = NULL, ip = 0.1, + use.expm = FALSE) { if (!inherits(phy, "phylo")) stop('object "phy" is not of class "phylo"') diff --git a/man/ace.Rd b/man/ace.Rd index 101aebf..ee66b0d 100644 --- a/man/ace.Rd +++ b/man/ace.Rd @@ -23,7 +23,8 @@ largest. } \usage{ -ace(x, phy, type = "continuous", method = "ML", CI = TRUE, +ace(x, phy, type = "continuous", method = if (type == "continuous") + "REML" else "ML", CI = TRUE, model = if (type == "continuous") "BM" else "ER", scaled = TRUE, kappa = 1, corStruct = NULL, ip = 0.1, use.expm = FALSE) @@ -71,31 +72,30 @@ ace(x, phy, type = "continuous", method = "ML", CI = TRUE, \details{ If \code{type = "continuous"}, the default model is Brownian motion where characters evolve randomly following a random walk. This model - can be fitted by maximum likelihood (the default, Schluter et - al. 1997), least squares (\code{method = "pic"}, Felsenstein 1985), or - generalized least squares (\code{method = "GLS"}, Martins and Hansen - 1997, Cunningham et al. 1998). In the latter case, the specification - of \code{phy} and \code{model} are actually ignored: it is instead - given through a correlation structure with the option - \code{corStruct}. + can be fitted by residual maximum likelihood (the default), maximum + likelihood (Schluter et al. 1997), least squares (\code{method = + "pic"}, Felsenstein 1985), or generalized least squares (\code{method + = "GLS"}, Martins and Hansen 1997, Cunningham et al. 1998). In the + last case, the specification of \code{phy} and \code{model} are + actually ignored: it is instead given through a correlation structure + with the option \code{corStruct}. - In the default setting (\code{method = "ML"} and \code{model = "BM"}) - the maximum likelihood estimation is done simultaneously on the - ancestral values and the variance of the Brownian motion process; - these estimates are then used to compute the confidence intervals in - the standard way. The REML method first estimates the ancestral value - at the root (aka, the phylogenetic mean), then the variance of the - Brownian motion process is estimated by optimizing the residual - log-likelihood. The ancestral values are finally inferred from the - likelihood function giving these two parameters. If \code{method = - "pic"} or \code{"GLS"}, the confidence intervals are computed using - the expected variances under the model, so they depend only on the - tree. + In the setting \code{method = "ML"} and \code{model = "BM"} (this used + to be the default until ape 3.0-7) the maximum likelihood estimation + is done simultaneously on the ancestral values and the variance of the + Brownian motion process; these estimates are then used to compute the + confidence intervals in the standard way. The REML method first + estimates the ancestral value at the root (aka, the phylogenetic + mean), then the variance of the Brownian motion process is estimated + by optimizing the residual log-likelihood. The ancestral values are + finally inferred from the likelihood function giving these two + parameters. If \code{method = "pic"} or \code{"GLS"}, the confidence + intervals are computed using the expected variances under the model, + so they depend only on the tree. It could be shown that, with a continous character, REML results in unbiased estimates of the variance of the Brownian motion process - while ML gives a downward bias. Therefore the former is recommanded, - even though it is not the default. + while ML gives a downward bias. Therefore the former is recommanded. For discrete characters (\code{type = "discrete"}), only maximum likelihood estimation is available (Pagel 1994). The model is