NPRS.criterion
computes the objective function to be minimized
in the NPRS (nonparametric rate smoothing) algorithm described in
Sanderson (1997).NPRS.criterion(phy, chrono, expo = 2, minEdgeLength = 1e-06)
"phylo"
), where the branch lengths are measured in
substitutions."phylo"
), where the branch lengths are measured in
absolute time.NPRS.criterion
returns the value of the objective function given
a phylogram and a chronogram.NPRS.criterion
- please use
chronogram
instead.ratogram
, chronogram
library(ape)
# get tree
data("landplants.newick") # example tree in NH format
tree.landplants <- read.tree(text = landplants.newick)
# plot tree
tree.landplants
plot(tree.landplants, label.offset = 0.001)
# estimate chronogram
chrono.plants <- chronogram(tree.landplants)
# plot and write to file
plot(chrono.plants, label.offset = 0.001)
write.tree(chrono.plants, file = "chronogram.phy")
# value of NPRS function for our estimated chronogram
NPRS.criterion(tree.landplants, chrono.plants)
Run the code above in your browser using DataLab