Re: [R-sig-phylo] ACE - ML

2011-05-17 Thread Liam J. Revell

Sorry, I didn't see that this had already been addressed.

--
Liam J. Revell
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com

On 5/17/2011 12:39 PM, David Bapst wrote:

Alanna-
It's because when multi2di() resolves the polytomies, it puts in zero-length
edges. This causes the phylogenetic variance-covariance matrix calculated
from your tree to be singular.

One solution would be to add a small arbitrary constant to your zero-length
edges, although I would caution you to try several different values and see
how your results differ.
-Dave Bapst, UChicago


On Tue, May 17, 2011 at 10:23 AM, Alanna Maltbyalanna.mal...@ioz.ac.ukwrote:


Dear all



I've been trying to use Maximum Likelihood to estimate ancestral
characters using ace in APE, but I get an error:




   ?Error in solve.default(out$hessian) :



   Lapack routine dgesv: system is exactly singular?




My code looks like this:



tree-read.nexus(tree.nex)

data-read.csv(data.csv)

BW-data.frame(data[,c(2,3)])

rownames(BW)-data[,2]

na.omit(BW)-BW

name.check(tree,BW)-overlap

drop.tip(tree,overlap$Tree.not.data)-tree2

tree3-multi2di(tree2)

BW2-BW[tree3$tip.label,]

BW3-data.frame(BW2[,2])

as.matrix(BW3)-BWM

as.vector(BWM)-BWV

names(BWV)-BW2[,1]

asrBW-ace(BWV, tree3, type=continuous)

asrBW$ace



which is possibly not super-elegant, but works when I use pic instead of
ML.



I notice that someone brought up the same problem last year but there
were no solutions. Any ideas?



Many thanks,



Alanna

-

Alanna Maltby

PhD Student - Evolution of Echolocation in Bats

University College London and Institute of Zoology

Tel: +44 (0) 20 7449 6322

Website: www.zsl.org/alannamaltbyhttp://www.zsl.org/alannamaltby





The Zoological Society of London is incorporated by Royal Charter
Principal Office England. Company Number RC000749
Registered address:
Regent's Park, London, England NW1 4RY
Registered Charity in England and Wales no. 208728

_
This e-mail has been sent in confidence to the named a...{{dropped:21}}


___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] ACE - ML

2011-05-17 Thread Liam J. Revell

Hi Alanna,

You can get this kind of error if your tree has tip edges with zero 
length.  Then C-vcv.phylo(tree) will be exactly singular.  Could this 
be true of your tree?


Best, Liam

--
Liam J. Revell
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://phytools.blogspot.com

On 5/17/2011 11:23 AM, Alanna Maltby wrote:

Dear all



I've been trying to use Maximum Likelihood to estimate ancestral
characters using ace in APE, but I get an error:




   ?Error in solve.default(out$hessian) :



   Lapack routine dgesv: system is exactly singular?




My code looks like this:



tree-read.nexus(tree.nex)

data-read.csv(data.csv)

BW-data.frame(data[,c(2,3)])

rownames(BW)-data[,2]

na.omit(BW)-BW

name.check(tree,BW)-overlap

drop.tip(tree,overlap$Tree.not.data)-tree2

tree3-multi2di(tree2)

BW2-BW[tree3$tip.label,]

BW3-data.frame(BW2[,2])

as.matrix(BW3)-BWM

as.vector(BWM)-BWV

names(BWV)-BW2[,1]

asrBW-ace(BWV, tree3, type=continuous)

asrBW$ace



which is possibly not super-elegant, but works when I use pic instead of
ML.



I notice that someone brought up the same problem last year but there
were no solutions. Any ideas?



Many thanks,



Alanna

-

Alanna Maltby

PhD Student - Evolution of Echolocation in Bats

University College London and Institute of Zoology

Tel: +44 (0) 20 7449 6322

Website: www.zsl.org/alannamaltbyhttp://www.zsl.org/alannamaltby





The Zoological Society of London is incorporated by Royal Charter
Principal Office England. Company Number RC000749
Registered address:
Regent's Park, London, England NW1 4RY
Registered Charity in England and Wales no. 208728

_
This e-mail has been sent in confidence to the named add...{{dropped:20}}

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo