YunyiShen / CAR-LASSO

Conditional Auto-Regressive LASSO in R
https://yunyishen.github.io/CAR-LASSO
GNU General Public License v3.0
17 stars 5 forks source link

warning and errors: matrix is not symmetric, arguments imply differing number of rows: 11, 9 #11

Open connor-morozumi opened 1 year ago

connor-morozumi commented 1 year ago

I am getting the following warnings and errors.

CARlasso(Didymellaceae +Cladosporium ramotenellum+Didymella sp.+ Didymosphaeriaceae + Didymellaceae.1 +Gibberella intricans+Colletotrichum spaethianum+Alternaria alternata+Coniothyrium sp.+ all_others~CO2 , data = forlasso,link = "logit", adaptive = TRUE, n_iter = 5000, n_burn_in = 1000, thin_by = 10)

warning: chol(): given matrix is not symmetric

and then with plot

Error in data.frame(id = c(paste0("resp", 1:n_resp), paste0("pred", 1:n_pred)), : arguments imply differing number of rows: 11, 9

mariano-molina commented 1 year ago

I get the same warning and error when I try to plot. Did you manage to find a solution? @connor-morozumi Please help, thanks @YunyiShen @crsl4

connor-morozumi commented 1 year ago

@mariano-molina I never did get a response nor did I figure this out myself. I think the warning and the plotting error are not inherently related. In playing around with it more I think I get the warning when i try to include too many taxa. How many are you trying to do?

The plot error can happen though even when the warning doesn't occur.

@crsl4 @YunyiShen

crsl4 commented 1 year ago

Thanks for reaching out! We are severely understaffed to tackle bugs, but we will definitely get back to you as soon as possible. Thanks for your patience!

connor-morozumi commented 1 year ago

@mariano-molina I did a bit of troubleshooting of this on my own today and actually got mine to run. Here are a few things I tried.

  1. at first I only had 1 predictor as my study only has one treatment contrast. Adding a fake predictor with 3 levels seems to have fixed this
  2. I also moved some columns around but doubt that matters (mirroring the example df str(mgp154))
  3. I also seemed to not be correctly including a col of all_others. So I used rowSums and then deleted the columns that were collapsed. I don't know if that is correct. This on it's own did not fix the issue.

So perhaps see after running CARlasso() if your predictors come back NULL with print(soy_res3$nodes)

If indeed it needs more than 1 predictor I am unsure this package will be very useful for me. But I may be doing something wrong. Cheers!

crsl4 commented 1 year ago

Ah interesting! Thanks for tracking down some potential sources of error. In our experiments, we always had more than one predictor, so maybe you are onto something. We'll check the code! Thanks!