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

Unable to run exclusive_lasso when Matrix size too large #19

Open
joannytan opened this issue Mar 1, 2024 · 0 comments
Open

Unable to run exclusive_lasso when Matrix size too large #19

joannytan opened this issue Mar 1, 2024 · 0 comments

Comments

@joannytan
Copy link

joannytan commented Mar 1, 2024

I am running into the error of

Error: Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD

I understand that this is due to large matrix error which should be the issue from the RcppArmadillo package. The sample code that run into issue as below.

library(glmnet)
library(ExclusiveLasso)

N = 80000 # number of observations
p = 35  # number of variables

# random generated X
X = matrix(rnorm(N*p), ncol=p)

# standardization : mean = 0, std=1
X = scale(X)

# artificial coefficients
beta = c(0.15,-0.33,0.25,-0.25,0.05,0,0,0,0.5,0.2,
         0.15,-0.33,0.25,-0.25,0.05,0,0,0,0.5,0.2,
         0.15,-0.33,0.25,-0.25,0.05,0,0,0,0.5,0.2,
         1, -0.2, 0.2, 0.1, 0.5)

# Y variable, standardized Y
y = X%*%beta + rnorm(N, sd=0.5)
#y = scale(y)

# group index for X variables
v.group <- rep(1:10, length.out = 35 )

#--------------------------------------------
# Model with a given lambda
#--------------------------------------------
# exclusive lasso
ex <- exclusive_lasso(X, y,lambda = 0.2, 
                      groups = v.group, family="gaussian", 
                      intercept = F)
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

1 participant