Re: [R-sig-phylo] ace() Warning message:, In sqrt(1/out$hessian) : NaNs produced

2017-05-18 Thread Juan Antonio Balbuena

  
  
Hi Emmanuel,
Thank you so much for taking the pain to check this. Looking at
  my vector of frequencies (Pfreq[,2]) it is pretty clear that it is
  hard to believe that the trait variance conforms to BM. 

All the best
Juan


El 18/05/2017 a las 10:00, Emmanuel
  Paradis escribió:

Hi Juan,
  
  
  This warning seems related to the fact that the trait did not
  evolve according to the specified model (i.e., Brownian motion). I
  simulated some data with:
  
  
      tr <- rphylo(50, .1, 0)
  
      x <- rTraitCont(tr)
  
  
  ace(x, tr)$sigma did not return NA out of 1000 replications. I
  changed the second line to:
  
  
      x <- rnorm(50)
  
  
  and NAs were returned in 18 cases.
  
  
  In your case, since you simulated the data, it could be that their
  distribution does not conform well to the Brownian motion model.
  Maybe you could transform them or discretize them and use a
  discrete trait model (i.e., Markovian model, type = "d" in ace).
  
  
  HTH
  
  
  Best,
  
  
  Emmanuel
  
  
  Le 11/05/2017 à 15:54, Juan Antonio Balbuena a écrit :
  
  Hi all


I am playing around with synthetic cophylogenetic data. In one
example, which represents a very extreme case of high agreement
between the host and parasite phylogenies (the data was
generated with 51 cospeciation, 2 sorting and 1 duplication
events), I get a warning when using ace() to label the
cophylogenetic nodes of the parasite tree:


fit.P<-ace(Pfreq[,2],obj$trees[[2]])

Warning message:

In sqrt(1/out$hessian) : NaNs produced


Where Pfreq[,2] is a vector of frequencies:


 >  Pfreq[,2]

  [1] 100.0 100.0  69.70874 100.0 100.0
100.0 100.0 100.0

  [9] 100.0 100.0 100.0  37.86408  38.44660 
62.13592 61.55340 100.0

[17] 100.0 100.0 100.0 100.0 100.0 100.0
100.0 100.0

[25] 100.0 100.0 100.0 100.0  62.13592 100.0
100.0 100.0

[33] 100.0 100.0 100.0 100.0 100.0 100.0
100.0 100.0

[41] 100.0 100.0  68.15534 100.0 100.0 100.0
100.0 100.0

[49] 100.0 100.0 100.0 100.0 100.0


The following works fine


nodelabels.cophylo(pie=fit.P$ace/100,
piecol=c("green","red"),cex=0.5, which="right")


but I have noticed that there is a NA in fit.P$sigma2. It would
be nice to know whether this warning is important or not.


Thank you very much for your attention.


Juan A. Balbuena



-- 

Dr. Juan A. Balbuena

Cavanilles Institute of Biodiversity and Evolutionary Biology

University of Valencia http://www.uv.es/~balbuena


P.O. Box 22085 http://www.uv.es/cophylpaco


46071 Valencia, Spain

e-mail: j.a.balbu...@uv.es tel.
+34 963 543 658    fax +34 963 543 733



*NOTE!*For shipments by EXPRESS COURIER use the following street
address:

C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia), Spain.





Pour nous remonter une erreur de filtrage, veuillez vous rendre
ici 





___

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/301EU0Nrv8J


  
  


-- 
  
  

  Dr.
Juan
A. Balbuena 
Cavanilles Institute of Biodiversity and Evolutionary
Biology 
University of
Valencia           
           
           
        http://www.uv.es/~balbuena

P.O. Box
22085           
          

[R-sig-phylo] ace() Warning message:, In sqrt(1/out$hessian) : NaNs produced

2017-05-11 Thread Juan Antonio Balbuena

  
  
Hi all
I am playing around with synthetic cophylogenetic data. In one
  example, which represents a very extreme case of high agreement
  between the host and parasite phylogenies (the data was generated
  with 51 cospeciation, 2 sorting and 1 duplication events), I get a
  warning when using ace() to label the cophylogenetic nodes of the
  parasite tree:
fit.P<-ace(Pfreq[,2],obj$trees[[2]])
  Warning message:
  In sqrt(1/out$hessian) : NaNs produced
Where Pfreq[,2] is a vector of frequencies:
>  Pfreq[,2]
   [1] 100.0 100.0  69.70874 100.0 100.0 100.0
  100.0 100.0
   [9] 100.0 100.0 100.0  37.86408  38.44660  62.13592 
  61.55340 100.0
  [17] 100.0 100.0 100.0 100.0 100.0 100.0
  100.0 100.0
  [25] 100.0 100.0 100.0 100.0  62.13592 100.0
  100.0 100.0
  [33] 100.0 100.0 100.0 100.0 100.0 100.0
  100.0 100.0
  [41] 100.0 100.0  68.15534 100.0 100.0 100.0
  100.0 100.0
  [49] 100.0 100.0 100.0 100.0 100.0
The following works fine

nodelabels.cophylo(pie=fit.P$ace/100,
  piecol=c("green","red"),cex=0.5, which="right")

but I have noticed that there is a NA in fit.P$sigma2. It would
  be nice to know whether this warning is important or not.
Thank you very much for your attention.
Juan A. Balbuena


-- 
  
  

  Dr.
Juan
A. Balbuena 
Cavanilles Institute of Biodiversity and Evolutionary
Biology 
University of
Valencia           
           
           
        http://www.uv.es/~balbuena

P.O. Box
22085           
           
           
           
    http://www.uv.es/cophylpaco
46071 Valencia,
Spain

e-mail: j.a.balbu...@uv.es   
tel.
+34 963 543 658    fax +34 963 543 733 
 
NOTE! For shipments by EXPRESS COURIER use
  the following street
  address: 
  C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia),
  Spain. 
  
  

  


___
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/