Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bGlasso malfunctions with probit link #9

Open
kjmtaylor22 opened this issue Jun 2, 2022 · 2 comments
Open

bGlasso malfunctions with probit link #9

kjmtaylor22 opened this issue Jun 2, 2022 · 2 comments

Comments

@kjmtaylor22
Copy link

kjmtaylor22 commented Jun 2, 2022

I've tried to run bGlasso with the same binary dataset as CARlasso (sans predictors). It runs fine with CARlasso and it appears to also be running fine with bGlasso when I use the count dataset and log link instead. The matrix is 122 rows by 25 columns

carNull <- bGlasso(data=phdat[,1:25], link="probit", n_iter=2000, n_burn_in = 1000, thin_by=10)

Algorithm start...
progress:
0% 10 20 30 40 50 60 70 80 90 100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
Error in Intercept_Graphical_LASSO_hir_Cpp(y, 3, n_iter, n_burn_in, thin_by, :
mvnrnd(): given covariance matrix is not symmetric positive semi-definite

@YunyiShen
Copy link
Owner

Thanks for trying it out! Would you mind providing say head of the binary dataset? One possible reason is that the majority of the dataset is 0 or 1's then the method is not very stable. I would suggest if you have count or composition data use the log or logit link.

@kjmtaylor22
Copy link
Author

Ok yeah, that makes sense. It ended up working just fine with the count data. I added the colSums as well so you could see the proportion of rows (actually 126, not 122) filled. I could try it again by removing some of the samples that have low diversity? There would still be a number of uncommon genera though.

head(phgen)

Oocystis Achnanthes Chlorella Stichococcus Chlorococcaceae Scenedesmus Monoraphidium all_others.1 Miscellaneous all_others Cosmarium unidentified Chlorophyta Oedogonium
X1 1 0 1 0 1 1 0 1 1 1 1 0 0 1
X2 1 1 1 1 0 1 0 1 1 1 1 1 1 1
X3 1 1 0 1 0 0 0 0 1 1 0 1 1 1
X4 1 0 1 1 1 1 1 1 1 1 1 1 1 1
X5 0 0 1 1 0 0 0 1 1 0 0 0 0 0
X6 0 0 0 1 0 0 0 0 0 0 0 0 0 0
Gymnodinium Chroococcus Amphora Spirogyra Lyngbya Cryptomonas Rhopalodia Zygnema Mougeotia Nitzschia Gomphonema Chroococcaceae Denticula Chlorococcum Pseudanabaena Ulothrix
X1 0 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0
X2 0 1 0 0 1 1 0 0 0 0 0 1 0 0 0 0
X3 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0
X4 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0
X5 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
X6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

colSums(phgen)

Oocystis Achnanthes Chlorella Stichococcus Chlorococcaceae Scenedesmus Monoraphidium all_others.1 Miscellaneous all_others Cosmarium
89 88 88 83 79 78 76 64 59 54 53
unidentified Chlorophyta Oedogonium Gymnodinium Chroococcus Amphora Spirogyra Lyngbya Cryptomonas Rhopalodia Zygnema
48 46 44 39 36 31 27 26 20 20 20
Mougeotia Nitzschia Gomphonema Chroococcaceae Denticula Chlorococcum Pseudanabaena Ulothrix
18 17 16 15 15 14 14 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants