logDensityTipsCauchy | R Documentation |
Compute the log density of the vector of trait at the tips of the phylogenetic tree, assuming a Cauchy process.
logDensityTipsCauchy(
tree,
tipTrait,
root.value = NULL,
disp,
method = c("reml", "random.root", "fixed.root"),
rootTip = NULL,
do_checks = TRUE
)
tree |
a phylogenetic tree of class |
tipTrait |
a names vector of tip trait values, with names matching the tree labels. |
root.value |
the root starting value of the process. |
disp |
the dispersion value. |
method |
the method used to compute the likelihood.
One of |
rootTip |
the tip used to re-root the tree, when the REML method is used.
If |
do_checks |
if |
The parameters of the Cauchy Process (CP)
are disp
, the dispersion of the process,
and root.value
, the starting value of the process at the root (for method="fixed.root"
).
The model assumes that each increment of the trait X
on a branch going from node k
to l
follows a Cauchy distribution, with a dispersion proportional to the length t_l
of the branch:
X_l - X_k \sim \mathcal{C}(0, \mbox{disp} \times t_l).
The method
argument specifies the type of likelihood that is computed:
method="reml"
:the dispersion parameter is fitted using the REML criterion,
obtained by re-rooting the tree to one of the tips.
The default tip used to reroot the tree is:
rootTip = which.min(colSums(cophenetic.phylo(tree)))
.
Any tip can be used, but this default empirically proved to be the most robust numerically;
method="random.root"
:the root value is assumed to be a random Cauchy variable, centered at root.value=0
,
and with a dispersion disp_root = disp * root.edge
;
method="fixed.root"
:the model is fitted conditionally on the root value root.value
,
i.e. with a model where the root value is fixed and inferred from the data.
the log density value.
fitCauchy
phy <- ape::rphylo(5, 0.1, 0)
dat <- rTraitCauchy(n = 1, phy = phy, model = "cauchy", parameters = list(root.value = 0, disp = 1))
logDensityTipsCauchy(phy, dat, 0, 1, method = "fixed.root")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.