Parameter Estimation of High-dimensional Mediation Models Based on Alternating Direction Method of Multipliers (ADMM)
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")
install.packages("HDMAADMM", repos = c('https://psyen0824.r-universe.dev', 'https://cloud.r-project.org'))
If you encounter a bug, please file a reproducible example on github.
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")
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
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.