Skip to content

psyen0824/HDMAADMM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HDMAADMM

Parameter Estimation of High-dimensional Mediation Models Based on Alternating Direction Method of Multipliers (ADMM)

Installation

Our package is on CRAN now, you can use install.packages to install. Also, you can install the latest developing version on GitHub via below command:

install.packages("remotes")
remotes::install_github("psyen0824/HDMAADMM")

If you encounter a bug, please file a reproducible example on github.

If you would like to have oneMKL support. Please use below commands to install:

install.packages(
  c("oneMKL", "oneMKL.MatrixCal"), 
  repos=c("https://cloud.r-project.org/", "https://R-OneMKL.github.io/drat"), 
  type = "source"
)
remotes::install_github("psyen0824/HDMAADMM", ref = "oneMKL")

Examples

simuData <- modalityMediationDataGen(seed = 20231201)

modelElasticNet <- singleModalityAdmm(
  X = simuData$MediData$X, Y = simuData$MediData$Y, M1 = simuData$MediData$M1,
  rho = 1, lambda1a = 1, lambda1b = 0.1, lambda1g = 2, lambda2a = 1, lambda2b = 1,
  penalty = "ElasticNet"
)

fitted(modelElasticNet)                              # fitted values
predict(modelElasticNet, matrix(c(0, 1), ncol = 1))  # predict values

Performance Comparison

Test data is generated by modalityMediationDataGen with n=200000 and p=500. The model is set to Elastic Net. RcppEigen + oneMKL version can be 7 times faster than Pure R version.

Unit: seconds
          category    mean neval  ratio
            Pure R  68.337     3   7.12
         RcppEigen  18.383     3   1.91
RcppEigen + oneMKL   9.603     3      1

This results are run on R-4.3.1 (Windows 11 Pro 22H2) with Intel i9-13900K.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published