Thanks for pointing me in the right direction. Jostein 27. apr. 2015 17:31 skrev "Emmanuel Paradis" <emmanuel.para...@ird.fr>:
> Hi Jostein, > > Le 27/04/2015 14:44, Jostein Gohli a écrit : > >> Hi, >> >> I have some questions about the method from this paper: >> >> Paradis et al. (2013) Quantifying variation in speciation and extinction >> rates with clade data. DOI: 10.1111/evo.12256 >> >> >> >> #Some hypothetical data: >> >> SpeciesCount <- c(2,13,2,2,8,1,16) >> Ages <- c(1,2,0.5,0.6,2,0.2,3) >> >> #And using the simplest model, assuming extinction rate = 0: >> >> halfdev <- function(p) { >> if (p <= 0 || p >= 2) return(1e100) >> -sum(dyule(SpeciesCount, p, Ages, log = TRUE)) >> } >> >> #optimizing with nlm: >> >> res <- nlm(halfdev, .1, hessian = TRUE) >> >> #Questions: >> #The halfdev function is a -lnL function, so using the nlm function will >> maximize >> #the likelihood, correct? >> > > Correct. > > #So, res$estimate is the estimate of lambda (for all clades) with the >> highest likelihood? >> > > Yes. > > #This means that I can use the following approach to get clade specific >> estimates of speciation rate: >> >> lambdas <- -dyule(SpeciesCount, res$estimate, Ages, log = TRUE) >> > > Not really. You are computing the respective contribution of each clade to > the deviance function. This cannot be taken as clade-level estimates. > > # lambdas summarized with data >> cbind(lambdas,SpeciesCount,Ages) >> >> # lambdas SpeciesCount Ages >> # 1.4798877 2 1.0 >> # 3.6698954 13 2.0 >> # 1.4207890 2 0.5 >> # 1.3906988 2 0.6 >> # 3.0143270 8 2.0 >> # 0.2096531 1 0.2 >> # 3.8052613 16 3.0 >> >> #And I can use these lambda values as a response variable in a pgls (or >> #equivalent) for downstream analysis of speciation rates? >> > > I guess you are looking for the Magallon-Sanderson estimate: > > log(SpeciesCount)/Ages > > HTH > > Best, > > Emmanuel > > Thanks in advance for all/any help. >> >> Jostein >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> R-sig-phylo mailing list - R-sig-phylo@r-project.org >> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo >> Searchable archive at >> http://www.mail-archive.com/r-sig-phylo@r-project.org/ >> >> >> Pour nous remonter une erreur de filtrage, veuillez vous rendre ici : >> http://f.security-mail.net/3072htDHdU2 >> >> >> > [[alternative HTML version deleted]] _______________________________________________ R-sig-phylo mailing list - R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/