tag:blogger.com,1999:blog-8499895524521663926.post6860360583661714169..comments2024-07-12T21:07:13.125-04:00Comments on Phylogenetic Tools for Comparative Biology: Update to phyl.pca so that "mode" (correlation vs. covariance) can be specified flexiblyLiam Revellhttp://www.blogger.com/profile/04314686830842384151noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-8499895524521663926.post-80090227072482046812024-03-20T10:55:46.454-04:002024-03-20T10:55:46.454-04:00Hi Liam,
I have the same problem like older commen...Hi Liam,<br />I have the same problem like older comments: <br /><br />> snockpcalambda<-phyl.pca(Tree_snocks, matrizlambda, method="lambda", mode="cor")<br />Error in solve.default(kronRC, y - D %*% a) : <br /> system is computationally singular: reciprocal condition number = 1.90357e-24<br /> However, it happens when I try to use the method lambda, when I use BM it runs with no problems. <br /><br />Regards, <br />Nati<br />Natihttps://www.blogger.com/profile/14733826176437120802noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-55072630759439783122016-10-27T20:03:58.027-04:002016-10-27T20:03:58.027-04:00This comes over a year later, but i had similar is...This comes over a year later, but i had similar issues with phyl.pca,and found that, like liam suggested, this issue can arise when some variables are perfect linear combinations of other variables - this may be true of some climatic variables.<br /><br />Trawling through some other forums I found a solution that by adding a random small number (0.00001 - 0.00009) to your data will remove the perfect linear relationship between variables without changing the underlying data such that the results will be altered significantly.<br /><br />The other option is removing these variables altogether if you know (or can find out) which ones they are.<br /><br />AlexAnonymoushttps://www.blogger.com/profile/11657568807391593226noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-91547680439552652682015-09-08T04:53:52.656-04:002015-09-08T04:53:52.656-04:00Hi Liam,
I have the same problem. I don't hav...Hi Liam,<br /><br />I have the same problem. I don't have zero length,but I have a lot more variables than species: dim(df)<br />6 163<br /><br />Is there a workaround for this situation as well?<br /><br />All the best and thank you for providing this great package!<br />DanielDaniel Langhttps://www.blogger.com/profile/14610670388540681870noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-48266142713382908072014-05-15T17:07:54.434-04:002014-05-15T17:07:54.434-04:00Hi Liam,
Unfortunately I keep on getting the same ...Hi Liam,<br />Unfortunately I keep on getting the same type of error. I don't have any zero length edges in the tree or more columns than rows in the data matrix. <br />The data are partial warps from a geometric morphometric analysis. If I use that matrix and do a normal PCA I get identical results as from relative warps. I have no idea what may be the problem with the phyl.pca. Would you be willing to have a look at my data, please. Maybe I'm missing something.<br /><br />Cheers<br /><br />Jose<br />Anonymoushttps://www.blogger.com/profile/14776516878742222854noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-22238018760223732602014-05-15T12:36:26.541-04:002014-05-15T12:36:26.541-04:00Thank you Liam, I'll try it and let you know.
...Thank you Liam, I'll try it and let you know.<br /><br />Cheers<br /><br />JoseAnonymoushttps://www.blogger.com/profile/14776516878742222854noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-65515964086516160022014-05-14T20:39:59.482-04:002014-05-14T20:39:59.482-04:00Are there zero-length terminal edges in the tree? ...Are there zero-length terminal edges in the tree? This makes vcv(tree) singular & can cause this error. The other possibility is that the covariance matrix among traits is singular, which happens if there are more columns (variables) than rows (species) in your input data matrix; or if some columns are perfect linear combinations of other variables.<br /><br />In at least the first case, one workaround suggested to me Eric Stone at NCSU, is to use the pseudoinverse:<br /><br />require(corpcor)<br />solve<-function(x) pseudoinverse(x)<br />pca<-phyl.pca(...)<br /><br />For this to work, though, you need to load phyl.pca & all internally called functions from source. This can be done using:<br /><br />source("http://www.phytools.org/utilities/v4.6/utilities.R")<br />source("http://www.phytools.org/phyl.pca/v0.5/phyl.pca.R")<br /><br />Let me know if this works.<br /><br />All the best, Liam<br />Liam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-80985469941357042002014-05-14T17:52:58.635-04:002014-05-14T17:52:58.635-04:00Hi Liam,
I'm having the same issue with "...Hi Liam,<br />I'm having the same issue with "Error in solve.default(kronRC, y - D %*% a) :<br />system is computationally singular: reciprocal condition number = 1.90653e-23"<br /><br />I don't know what is going on. I have run phyl.pca before with no problems. I went to the data and there is no zeros or missing information. Any idea of other possibilities for this error?<br /><br />Thanks<br /><br />Jose<br />Anonymoushttps://www.blogger.com/profile/14776516878742222854noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-86479925504074351982012-12-23T12:18:49.816-05:002012-12-23T12:18:49.816-05:00Hi Renske.
Does your try have terminal branch len...Hi Renske.<br /><br />Does your try have terminal branch lengths that are zero? That's one thing that will cause singularity of vcv.phylo(tree), which means the phylogenetic PCA cannot be computed. If not that, maybe send me data & tree and I would be happy to investigate further.<br /><br />- LiamLiam Revellhttps://www.blogger.com/profile/04314686830842384151noreply@blogger.comtag:blogger.com,1999:blog-8499895524521663926.post-24916693259741690182012-12-18T10:28:07.348-05:002012-12-18T10:28:07.348-05:00Hi Liam,
I try to run the phyl.pca function, but I...Hi Liam,<br />I try to run the phyl.pca function, but I keep on getting this error message: <br /><br />"Error in solve.default(kronRC, y - D %*% a) : <br /> system is computationally singular: reciprocal condition number = 3.02577e-028"<br /><br />Can't figure out what is wrong with the data. Do you have any idea? It does run the demo, so I assume my input files are somehow wrong. I have a tree in nexus format, and a trait file input in csv format (no missing data), with names linked to the traits (data <- traits[,2:7]<br />rownames(data) <- traits$name).<br />Hope you can help?<br /><br />Renske<br /><br /> <br />Renskenoreply@blogger.com