gbradburd/conStruct

element that is not positive definite, xvalidation

Closed this issue · 3 comments

Hi,
I'm having an issue that I see others have had, in that I'm trying to run a cross validation analysis and am getting the error message "Error in check.data.partitions.covmats(args) : you have specified an invalid data partition "data" element that is not positive definite". I ran this dataset with the regular conStruct analyses with no issues.
I realize a solution is to remove samples with lots of missing data, but I'm to the point of removing samples with less than 50% missing data and am wondering if there might be some other issue at play. This is a large dataset (3,564 loci).
Any help is greatly appreciated!
Pg_xvalid.const.RData.zip

thom

Hi Thom,

I took a look at the data and I get that issue about 50% of the time, probably as a result of missing data. However, an easy fix is to change your training proportion to 80% instead of 90%, which, when I tested it, worked with your data 100% of the time. Alternatively, when I removed the 4 samples that had greater than 30% missing data, running cross-validation with 90% training proportion of the data worked 100% of the time. Make sure you're running the most up-to-date version of conStruct (installation instructions below), and let me know if you have further issues.

library(devtools)
install_github("gbradburd/conStruct", ref="covariance_fix")

Thanks Gideon! I was able to return 2 samples that I had removed and get it to run with a training proportion of 80%, so I'm going with that. I appreciate the help!

thom

Ok great! I'm going close this issue, but feel free to reopen if this is unresolved (or to open a new one if new stuff crops up).