Skip to content

Unable to run exclusive_lasso when Matrix size too large #19

@joannytan

Description

@joannytan

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions