cvSingleModalityAdmm {HDMAADMM} | R Documentation |
Cross Validation for High-dimensional Single Mediation Models
Description
Cross Validation for High-dimensional Single Mediation Models
Usage
cvSingleModalityAdmm(
X,
Y,
M1,
numFolds = 10,
typeMeasure = "rmse",
lambda1a,
lambda1b,
lambda1g,
lambda2a,
lambda2b,
rho = 1,
penalty = "ElasticNet",
penaltyParameterList = list(),
SIS = FALSE,
SISThreshold = 2,
maxIter = 3000,
tol = 1e-04,
verbose = FALSE,
debug = FALSE
)
Arguments
X |
The matrix of independent variables (exposure/treatment/group). |
Y |
The vector of dependent variable (outcome response). |
M1 |
The single-modality mediator. |
numFolds |
The number of folds. The default is 10. Although nfolds can be as large as the sample size (leave-one-out CV), it is not recommended for large datasets. Smallest value allowable is nfolds=3. |
typeMeasure |
Default is "rmse". |
rho , lambda1g , lambda1a , lambda1b , lambda2a , lambda2b , penaltyParameterList |
Allow to put sequences for each parameter. Please refer to the function, |
penalty , SIS , SISThreshold , maxIter , tol , verbose , debug |
Please refer to the function, |
Value
An cvSingleModalityAdmm
object which is a matrix containing all the combinations of parameter sequences with an additional column called measure
.
Examples
## Generate Empirical Data
simuData <- modalityMediationDataGen(seed = 20231201)
## Cross-Validation for ElasticNet penalty
cvElasticNetResults <- cvSingleModalityAdmm(
X = simuData$MediData$X, Y = simuData$MediData$Y, M1 = simuData$MediData$M1,
numFolds = 5, typeMeasure = "rmse",
rho = c(0.9, 1, 1.1), lambda1a = c(0.1, 0.5, 1), lambda1b = c(0.1, 0.3),
lambda1g = c(1, 2), lambda2a = c(0.5, 1), lambda2b = c(0.5, 1),
penalty = "ElasticNet"
)
## Cross-Validation for Pathway Lasso penalty (lambda2a, lambda2b are not tuned.)
cvPathwayLassoResults <- cvSingleModalityAdmm(
X = simuData$MediData$X, Y = simuData$MediData$Y, M1 = simuData$MediData$M1,
numFolds = 5, typeMeasure = "rmse",
rho = c(0.9, 1, 1.1), lambda1a = c(0.1, 0.5, 1), lambda1b = c(0.1, 0.3),
lambda1g = c(1, 2), lambda2a = 1, lambda2b = 1,
penalty = "PathwayLasso", penaltyParameterList = list(kappa = c(0.5, 1), nu = c(1, 2))
)
[Package HDMAADMM version 0.0.1 Index]