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

Errors:decomposition failed and matrix is singular or not positive definite #12

Open
Sophiayangg opened this issue Mar 20, 2024 · 1 comment

Comments

@Sophiayangg
Copy link

Sophiayangg commented Mar 20, 2024

Two errors that I've found when running the package are that:

  1. Error: chol(): decomposition failed
CARlasso(Ga0485157_metabat1.059+Ga0485167_maxbin.109+ Ga0485162_maxbin.089+Ga0485161_maxbin.110+Ga0485161_maxbin.075+Ga0485157_metabat1.036+Ga0485165_metabat2_ours.012_sub+Ga0485169_maxbin.201_sub+Ga0485172_maxbin.081_sub+Ga0485168_maxbin.153+ Ga0485172_metabat2_ours.083+ Ga0485162_maxbin.023+ Ga0485160_maxbin.092+ Ga0485158_metabat2_jgi.024+ Ga0485162_metabat1.001+**Ga0485163_metabat1.131**~ depth+wtemp+sp_cond+chlor_rfu+phyco_rfu+fdom_rfu+turb_fnu+do_sat+do_raw+ph, data = data_use, link="log",adaptive = TRUE, n_iter = 5000, n_burn_in = 1000, thin_by = 10)

It is only related to the last column of the responses(Ga0485163_metabat1.131). when removing this last one, the error is gone.

  1. Error: inv_sympd(): matrix is singular or not positive definite
CARlasso(Ga0485157_metabat1.059+Ga0485167_maxbin.109+ Ga0485162_maxbin.089+Ga0485161_maxbin.110+Ga0485161_maxbin.075+Ga0485157_metabat1.036+Ga0485165_metabat2_ours.012_sub+Ga0485169_maxbin.201_sub+Ga0485172_maxbin.081_sub+Ga0485168_maxbin.153+ Ga0485172_metabat2_ours.083+ Ga0485162_maxbin.023+ Ga0485160_maxbin.092+ Ga0485158_metabat2_jgi.024+ Ga0485162_metabat1.001+**Ga0485157_metabat2_jgi.016**~ depth+wtemp+sp_cond+chlor_rfu+phyco_rfu+fdom_rfu+turb_fnu+do_sat+do_raw+ph, data = data_use, link="log",adaptive = TRUE, n_iter = 5000, n_burn_in = 1000, thin_by = 10)

Also related to the last column of the responses(Ga0485157_metabat2_jgi.016). when removing this last one, the error is gone.

Down below is a small dataset to reproduce the error:
selected_otus.csv

Down below are the reproducible code

library(CARlasso)
data_use <-read.csv("selected_otus.csv")
otu_res <- CARlasso(Ga0485157_metabat1.059+Ga0485167_maxbin.109+ Ga0485162_maxbin.089+Ga0485161_maxbin.110+Ga0485161_maxbin.075+Ga0485157_metabat1.036+Ga0485165_metabat2_ours.012_sub+Ga0485169_maxbin.201_sub+Ga0485172_maxbin.081_sub+Ga0485168_maxbin.153+ Ga0485172_metabat2_ours.083+ Ga0485162_maxbin.023+ Ga0485160_maxbin.092+ Ga0485158_metabat2_jgi.024+ Ga0485162_metabat1.001+Ga0485163_metabat1.131~ depth+wtemp+sp_cond+chlor_rfu+phyco_rfu+fdom_rfu+turb_fnu+do_sat+do_raw+ph, data = data_use, link="log",adaptive = TRUE, n_iter = 5000, n_burn_in = 1000, thin_by = 10)
otu_res <- horseshoe(otu_res)
plot(otu_res)
@crsl4
Copy link
Collaborator

crsl4 commented Mar 20, 2024

Can you add the commands to read the data as well so that there is a reproducible set of commands? Thanks Sophia!

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