Hi Sebastien,Thanks for alerting me to this. Gene is correct, there is no way to detect a trend with a tree where all the tips line up. Still, there was also a bug in fitContinuous. I've made a quick fix - your example should work if you first "source" the attached r file. You will now get the same likelihood for "trend" as you get for "BM," as it should be. I should probably also put a warning message, I'll do that and submit a new version to CRAN.
Anyone else using this function, this bug would not have affected your results; it just made the function crash in some cases, for exactly the reason Ben states in his reply.
Luke
fitContinuous.R
Description: Binary data
On Jan 16, 2009, at 8:53 AM, Sebastien Lavergne wrote:
Dear all,I am trying to fit a number of different evolutionary models to a data set of continuous traits using the functions fitContinuous (from library geiger), but I am having trouble to have the function fit a model of Brownian motion with a trend (see example code below). I get an error message and I am not even sure to fully understand it. Does anybody have an idea of where this comes from? or is this simply a bug of the function ?Any help appreciated. Regards Seb PS- Here is a sample code with simulated tree and data : > library(ape) ; library(geiger) ; library(picante) > tree <- rcoal(250) > traits <- evolve.brownian(tree, value=2, var=0.5) > try.fit<- fitContinuous(tree, traits, model="trend") Fitting trend model:Erreur dans optim(p0, fn = lnl.BMtrend, vcv = vcv, x = y, se = meserr, lower = lower, :valeur non-finie fournie par optim Translation for the error message: Error in optim(...), no value provided by optim -- ------------------------------------------------------------------------- Sébastien Lavergne Laboratoire d'Ecologie Alpine, UMR-CNRS 5553 Université Joseph Fourier BP 53, 38041 Grenoble Cedex 9, France tel +33 (0)4 76 63 54 50 http://www-leca.ujf-grenoble.fr/membres/lavergne.htm http://sebastien.lavergne.perso.neuf.fr/ _______________________________________________ R-sig-phylo mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
_______________________________________________ R-sig-phylo mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
