yunyishen / car-lasso Goto Github PK
View Code? Open in Web Editor NEWConditional Auto-Regressive LASSO in R
Home Page: https://yunyishen.github.io/CAR-LASSO
License: GNU General Public License v3.0
Conditional Auto-Regressive LASSO in R
Home Page: https://yunyishen.github.io/CAR-LASSO
License: GNU General Public License v3.0
For higher dimension cases the formula can be too long to approach, we should have CARlasso allowing matrix input.
This can be done by users themselves but can be better done as a function since we generated the network object during plot
methods anyway.
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
Two errors that I've found when running the package are that:
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.
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)
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.