Giter Site home page Giter Site logo

yunyishen / car-lasso Goto Github PK

View Code? Open in Web Editor NEW
17.0 3.0 5.0 291.32 MB

Conditional Auto-Regressive LASSO in R

Home Page: https://yunyishen.github.io/CAR-LASSO

License: GNU General Public License v3.0

C++ 80.68% R 17.39% C 1.94%
gaussian-field lasso-regression bayesian markov-random-field

car-lasso's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

car-lasso's Issues

Function generate igraph objects

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.

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

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

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

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)

bGlasso malfunctions with probit link

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.