X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=R%2FCDF.birth.death.R;h=7ba5f5eb175d078472c6a8c7ccc1a818c1c67d57;hb=f5c4abe6ac31486e821d82788bf66b5db2be51d1;hp=847c37dcd20dd60ecc4649a725ff27ccfe27fd59;hpb=6603d33385e67db10a1d48f3ab7ec1910ce295ca;p=ape.git diff --git a/R/CDF.birth.death.R b/R/CDF.birth.death.R index 847c37d..7ba5f5e 100644 --- a/R/CDF.birth.death.R +++ b/R/CDF.birth.death.R @@ -1,9 +1,9 @@ -## CDF.birth.death.R (2010-09-27) +## CDF.birth.death.R (2012-09-14) -## Functions to simulate and fit +## Functions to Simulate and Fit ## Time-Dependent Birth-Death Models -## Copyright 2010 Emmanuel Paradis +## Copyright 2010-2012 Emmanuel Paradis ## This file is part of the R-package `ape'. ## See the file ../COPYING for licensing issues. @@ -158,7 +158,9 @@ CDF.birth.death <- if (!case %in% c(1, 3, 6)) Pi <- Vectorize(Pi) - denom <- if (fast) integrateTrapeze(Pi, 0, Tmax) else integrate(Pi, 0, Tmax)$value + denom <- + if (fast) integrateTrapeze(Pi, 0, Tmax) + else integrate(Pi, 0, Tmax)$value n <- length(x) p <- numeric(n) if (fast) { @@ -178,6 +180,7 @@ CDF.birth.death <- phy <- list(edge = edge, edge.length = edge.length, tip.label = paste("t", 1:(i + 1), sep = ""), Nnode = i) class(phy) <- "phylo" + attr(phy, "order") <- "cladewise" phy }