singleModalityAdmm {HDMAADMM} | R Documentation |
High-dimensional Single Modality Mediation Models
Description
High-dimensional Single Modality Mediation Models
Usage
singleModalityAdmm(
X,
Y,
M1,
rho = 1,
lambda1a,
lambda1b,
lambda1g,
lambda2a,
lambda2b,
penalty = "ElasticNet",
penaltyParameterList = list(),
SIS = FALSE,
SISThreshold = 2,
maxIter = 3000L,
tol = 0.001,
verbose = FALSE,
verboseOptions = list(numIter = 10L, numAlpha = 1L, numBeta = 1L, numGamma = 1L)
)
Arguments
X |
The matrix of independent variables (exposure/treatment/group). |
Y |
The vector of dependent variable (outcome response). |
M1 |
The single-modality mediator. |
rho |
The augmented Lagrangian parameter for ADMM. |
lambda1a |
The L1-norm penalty for the effect between mediator and independent variables. |
lambda1b |
The L1-norm penalty for the effect between mediator and dependent variable. |
lambda1g |
The L1-norm penalty for the direct effect. Default is 10 to adress overestimate issue. |
lambda2a |
The L2-norm penalty for the effect between mediator and independent variables.
It's not used when Penalty is |
lambda2b |
The L2-norm penalty for the effect between mediator and dependent variable.
It's not used when Penalty is |
penalty |
A string to specify the penalty. Default is |
penaltyParameterList |
|
SIS |
A logical value to specify whether to perform sure independence screening (SIS). |
SISThreshold |
The threshold value for the target reduced dimension for mediators. The default is "2," which reduces the dimension to 2*n/log(n). |
maxIter |
The maximum iterations. Default is |
tol |
The tolerence of convergence threshold. Default is |
verbose |
A logical value to specify whether to print the iteration process. |
verboseOptions |
A list of values:
|
Value
A object, SingleModalityAdmm, with three elements.
gamma: estimated direct effect.
alpha: estimate effect between mediator and independent variables.
beta : estimate effect between mediator and dependent variable.
Examples
## Generate Empirical Data
simuData <- modalityMediationDataGen(seed = 20231201, generateLaplacianMatrix = TRUE)
## Parameter Estimation for ElasticNet penalty
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 & predict
fitted(modelElasticNet)
predict(modelElasticNet, matrix(c(0, 1), ncol=1))
## Parameter Estimation for Pathway Lasso penalty
modelPathwayLasso <- 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 = "PathwayLasso", penaltyParameterList = list(kappa = 1, nu = 2)
)
## Parameter Estimation for Network penalty
modelNetwork <- 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 = "Network", penaltyParameterList = list(laplacianMatrix = simuData$Info$laplacianMatrix)
)
## Parameter Estimation for Network penalty with a customized Laplacian matrix
set.seed(20231201)
p <- ncol(simuData$MediData$M1)
W <- matrix(0, nrow = p, ncol = p)
W[lower.tri(W)] <- runif(p*(p-1)/2, 0, 1)
W[upper.tri(W)] <- t(W)[upper.tri(W)]
diag(W) <- 1
L <- weightToLaplacian(W)
modelNetwork <- 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 = "Network", penaltyParameterList = list(laplacianMatrix = L)
)
## With sure independence screening
## Generate Empirical Data
simuData <- modalityMediationDataGen(n = 50, p = 1000, seed = 20231201)
## Parameter Estimation for ElasticNet penalty
modelElasticNetSIS <- 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", SIS = TRUE
)
fitted(modelElasticNetSIS)
predict(modelElasticNetSIS, matrix(c(0, 1), ncol=1))