Motivated by Bagging1, we implemented the Boot.Vote
procedure as an alternative to CV.Vote
for the purpose of variance reduction and FDR control.
The Boot.Vote
procedure fits the spaceMap model on \(B\) bootstrapped re-samples of the data, which results in an ensemble of \(B\) fitted networks. If an edge appears in the majority of these networks, then it is considered sufficiently reliable to be included in the final network. In our experience,Boot.Vote
often lowers the FDR at a small cost to the power compared to the CV.vote
procedure.
This section contains a basic illustration on how to build an ensemble of networks for the spaceMap model through the sim1 simulation data.
library(spacemap)
data(sim1)
Model fitting is much faster if parallel computation is leveraged. If you choose to set up a parallel back-end (in this case for a multicore machine), it will use all available cores minus 1.
#if dopar==true, then model tuning done in parallel
dopar <- FALSE
if (dopar) {
suppressPackageStartupMessages(library(doParallel))
suppressPackageStartupMessages(library(parallel))
ncores <- detectCores() - 1
cl <- makeCluster(ncores)
registerDoParallel(cl)
}
Fit an ensemble of networks for the spaceMap model with 100 bootstrap replicates by the bootEnsemble and bootVote functions.
#define tune penalty parameters
tune <- list(lam1 = 73, lam2 = 31, lam3 = 20.5)
smapens <- bootEnsemble(Y = sim1$Y, X = sim1$X, tune = tune,
method = "spacemap", B = 100)
smapbv <- bootVote(smapens)
The final network is stored as a list of two adjacency matrices.
str(smapbv$bv)
## List of 2
## $ yy: num [1:171, 1:171] 0 0 0 0 0 0 0 0 0 0 ...
## ..- attr(*, "dimnames")=List of 2
## .. ..$ : NULL
## .. ..$ : NULL
## $ xy: num [1:14, 1:171] 0 0 0 0 0 0 0 0 0 0 ...
## ..- attr(*, "dimnames")=List of 2
## .. ..$ : NULL
## .. ..$ : NULL
Breiman, Leo (1996). “Bagging predictors”. Machine Learning. 24 (2): 123–140. doi:10.1007/BF00058655.↩