missoNet
is a novel approach to fitting penalized
multi-task regression models, which are used to estimate the
coefficients of predictor variables for multiple correlated
tasks/response variables. The package achieves this by simultaneously
estimating the regression coefficients and the conditional response
network structure given all predictors, using penalized maximum
likelihood in an undirected conditional Gaussian graphical model. In
contrast to most penalized multi-task regression methods, such as
conditional graphical lasso, missoNet
is capable of
obtaining estimates even when the response data is corrupted by missing
values. The method is based on convex optimization, which provides both
theoretical and computational benefits, and returns solutions that are
comparable to the estimates obtained without any missing values.
The package provides an integrated set of core routines including 1)
generation of simulation data; 2) model fitting and cross-validation; 3)
visualization of results; 4) predictions in new data. The function
arguments are specified in the same style as those of
glmnet
, making it easy for experienced users to get
started.
To install the package missoNet
from CRAN, type the
following command in the R console:
install.packages("missoNet")
Or install the development version of missoNet
from
GitHub:
if(!require("devtools")) {
install.packages("devtools")
}::install_github("yixiao-zeng/missoNet", build_vignettes = TRUE) devtools
An example of how to use the package:
# Simulate a dataset with response values missing completely at random (MCAR),
# the overall missing rate is around 10%.
<- generateData(n = 300, p = 50, q = 20, rho = 0.1, missing.type = "MCAR")
sim.dat <- 1:240 # training set indices
tr <- 241:300 # test set indices
tst <- sim.dat$X[tr, ] # predictor matrix
X.tr <- sim.dat$Z[tr, ] # corrupted response matrix
Y.tr
# Perform a five-fold cross-validation on the training data.
<- cv.missoNet(X = X.tr, Y = Y.tr, kfold = 5)
cvfit
# Alternatively, compute the cross-validation folds in parallel.
<- parallel::makeCluster(min(parallel::detectCores()-1, 3))
cl <- cv.missoNet(X = X.tr, Y = Y.tr, kfold = 5,
cvfit parallel = TRUE, cl = cl)
::stopCluster(cl)
parallel
# Plot the standardized mean cross-validated errors in a heatmap.
plot(cvfit)
# Extract the estimates at "lambda.min" that gives the minimum cross-validated error.
<- cvfit$est.min$Beta
Beta_hat <- cvfit$est.min$Theta
Theta_hat
# Make predictions of response values on the test set.
<- predict(cvfit, newx = sim.dat$X[tst, ], s = "lambda.min") newy
See the vignette for more detailed information.
vignette("missoNet")