Compute the posterior density of a set of node values under a Cauchy process on a phylogenetic tree.
posteriorDensityAncestral(
node,
vals,
tree,
tipTrait,
root.value = NULL,
disp,
method = c("reml", "random.root", "fixed.root")
)
the node for which to compute the posterior density.
the table of values where the density should be computed.
a phylogenetic tree of class phylo
.
a names vector of tip trait values, with names matching the tree labels.
the root starting value of the process.
the dispersion value.
the method used to compute the likelihood.
One of reml
(the default), fixed.root
or random.root
.
See Details.
the posterior density value.
This function is internally called by ancestral
, which
is the preferred way of doing ancestral reconstruction on a fitted
object.
phy <- ape::rphylo(5, 0.1, 0)
dat <- rTraitCauchy(n = 1, phy = phy, model = "cauchy", parameters = list(root.value = 0, disp = 1))
posteriorDensityAncestral(7, 0.1, phy, dat, disp = 1)
#> [1] 0.05013013