Fits spacemap model to B bootstrapped data replicates to create an ensemble network.

bootEnsemble(Y, X = NULL, tune, method = c("spacemap", "space"),
  boot = TRUE, B = 100L, resPath = tempdir(), iscale = TRUE,
  aszero = 1e-06, seed = sample.int(n = 1e+06, size = 1), p0 = 1, ...)

Arguments

Y

Numeric matrix \((N \times Q)\) containing N iid samples of the response vector \(\textbf{y}\).

X

Numeric matrix \((N \times P)\) containing N iid samples of the predictor vector \(\textbf{x}\).

tune

List with names being the tuning penalties lam1, lam2, lam3 and each element being a single numeric value that is input to spacemap. One might consider the output from cvVote (i.e. list minTune) as input for this parameter.

method

Character value specifying to use spacemap or space in fitting ensemble network.

boot

Logical. Default is boot=TRUE and implies sampling with replacement (i.e. boostrap). boot=FALSE will resample without replacement.

B

Positive integer denoting the number of model fits making up the ensemble. Default is 1000, but can be lowered to save time.

resPath

Character vector specifying the directory where each each model fit to bootstrap replicate data is written to file through serialization by saveRDS. Defaults to temporary directory that will be deleted at end of the R session. It is recommended to specify a directory where results can be stored permanently.

iscale

Logical indicating to standardize the whole input data. Defaults to TRUE. See base::scale(x, center = TRUE, scale = TRUE) for details of standardization.

aszero

Positive numeric value (defaults to 1e-6) indicating at what point to consider extremely small parameter estimates of \(\Gamma\) and \(\rho\) as zero.

seed

Positive integer allowing user to set the random seed for reproducing the network ensemble.

p0

Positive numeric not exceeding the default of 1, which represents the proportion of the original samples that will be down-sampled for each model fitting iteration of the ensemble.

...

Additional arguments for spacemap or space.

Value

A list, call it ens, up to length B of convergent model fits from either spacemap or space. ens should typically not be modified by the user, but passed on to the bootVote function. Non-convergent model fits to bootstrap replciates are not included in list `ens`, but can be inspected individually at location resPath and are identified by attr(good, which = "not_conv_bootids").

See also

bootVote, cvVote

Examples

#Load simulation library(spacemap) data(sim1) #Boostrap Ensemble (B = 10) for illustration only tune <- data.frame(lam1 = 70, lam2 = 28, lam3 = 17.5) ens <- bootEnsemble(Y = sim1$Y, X = sim1$X, tune = tune, method = "spacemap", B = 10)
#> Warning: executing %dopar% sequentially: no parallel backend registered
#> Loading required package: pkgmaker
#> Loading required package: registry
#> #> Attaching package: ‘pkgmaker’
#> The following object is masked from ‘package:base’: #> #> isNamespaceLoaded