derivative_KDE {ontophylo} | R Documentation |
Calculates the derivative of the normalized Markov KDE or normalized loess smoothing over edges.
derivative_KDE(tree.discr, Edge.KDE.stat)
tree.discr |
simmap or phylo object. A discretized tree using the 'discr_Simmap' function. |
Edge.KDE.stat |
list. A list with the estimated normalized or loess smoothing KDEs for each edge. |
A list with the distribution of the derivatives calculated for each edge.
Sergei Tarasov
data("hym_tree", "hym_kde")
# Get reference tree.
tree_discr <- discr_Simmap(hym_tree, res = 200)
# Get smoothing of normalized edge KDE data for mean rates.
Edge_KDE <- hym_kde$head
Edge_KDE_stat <- Edge_KDE$loess.lambda.mean
# Calculate derivatives.
Edge_KDE$loess.lambda.mean.deriv <- derivative_KDE(tree_discr, Edge_KDE_stat)
# Check derivatives of some arbitrary branch.
Edge_KDE$loess.lambda.mean.deriv[[5]]