boot: Bootstrap sgcca

boot_samples_sgccaR Documentation

Bootstrap sgcca

Description

Function to perform bootstrap on the samples. boot_samples_sgcca bootstrap given original data, while boot_index_sgcca() given some index of samples it iterates over it.

Usage

boot_samples_sgcca(..., nb_boot = 1000, verbose = TRUE)

boot_index_sgcca(index, ..., BPPARAM = BiocParallel::SerialParam())

Arguments

...

Named arguments passed to sgcca.

nb_boot

Number of bootstraps to perform.

verbose

Logical, should it print a progress bar (default) or not?

index

A list of numeric values for selecting values

BPPARAM

Set up parallel backend (see BiocParallel documentation).

Details

boot_index_sgcca Iterate over the index, which is a list of vectors with the position of samples to use and use sgcca with the arguments provided. boot_samples_sgcca Iterate over random samples without recording which samples where used.

Value

A list with two elements: the coefficient of each variable of the input blocks; and the AVE values, both inner, and outer

Note

Recommended to provide scaled data and the argument scale = FALSE

See Also

boot_index()

Examples

data("Russett", package = "RGCCA")
X_agric <- as.matrix(Russett[, c("gini", "farm", "rent")])
X_ind <- as.matrix(Russett[, c("gnpr", "labo")])
X_polit <- as.matrix(Russett[ , c("inst", "ecks",  "death", "demostab",
                                  "dictator")])
A <- list(X_agric, X_ind, X_polit)
C <- matrix(c(0, 0, 1, 0, 0, 1, 1, 1, 0), 3, 3)
out <- boot_samples_sgcca(A = A, C = C, c1 = rep(1, 3),  nb_boot = 10)
head(out$AVE)
boots <- 10
index <- boot_index(nrow(A[[1]]), boots)
boot_i <- boot_index_sgcca(index, A = A, C = C)

llrs/inteRmodel documentation built on April 1, 2022, 4:04 p.m.