sparse.mediation.largep_omega.Rd
Fit a mediation model via penalized maximum likelihood and structural equation model. The regularization path is computed for the lasso or elasticnet penalty at a grid of values for the regularization parameter lambda. Currently, mediation analysis is developed based on gaussian assumption.
sparse.mediation.largep_omega(X, M, Y, tol = 10^(-10), max.iter = 10, lambda2 = 0.3, lambda1 = seq(0.02, 0.4, length = 5), tau = 1, alpha = 1, verbose = FALSE, Omega.out = FALSE)
X | One-dimensional predictor |
---|---|
M | Multivariate mediator |
Y | Outcome |
tol | (default -10^(-10)) convergence criterion |
max.iter | (default=100) maximum iteration |
lambda2 | Tuning parameter for Covariance matrix L1 penalization |
lambda1 | (default=seq(0.02,0.4,length=5)) tuning parameter for regression coefficient L1 penalization |
tau | (default=1) tuning parameter for L1 penality weighting for paths a and b. |
alpha | (defult=1) tuning parameter for L2 penalization |
verbose | (default=FALSE) print progress |
Omega.out | (defult=FALSE) output Omega estimates (beta version WIP.) |
c directeffect
hatb Path b (M->Y given X) estimates
hata Path a (X->M) estimates
medest Mediation estimates (a*b)
alpha
lambda1 Tuning parameters for regression coefficients
lambda2 Tuning parameters for inversed covariance matrix (Omega)
nump Number of selected mediation paths
Omega Estimated covariance matrix of the mediator
Multiple Mediaton Model: (1) M = Xa + e1 (2) Y = Xc' + Mb + e2 And in the optimization, we do not regularize c', due to the assumption of partial mediation.
TBA
library(sparsemediation) N=100 V=200 set.seed(1234) covmat=matrix(0,V+2,V+2); covmat[1,2]=0.5;covmat[1, (1:3)+2]=rep(0.5,3);covmat[2, (1:3)+2]=rep(0.5,3); covmat=covmat+t(covmat);diag(covmat)<-1 sqrtmat = sqrtmat.comp(covmat) tmpmat = matrix(rnorm(N*(V+2)),N,V+2) %*% sqrtmat X=tmpmat[,1] Y=tmpmat[,2] M=tmpmat[,-c(1:2)] #fit=sparse.mediation.largep_omega(X,M,Y)