reindexVectorsByK: Used to study of the bootstrap distribution of the k^th...

Description Usage Arguments Value Examples

View source: R/bootstrap_functions.R

Description

Used to study of the bootstrap distribution of the k^th singular values, by re-indexing the list of d^b vectors to be organized by PC index (k) rather than bootstrap index (b).

Usage

1
reindexVectorsByK(vectorsByB)

Arguments

vectorsByB

a B-length list, containing vectors with the n values from each bootstrap sample.

Value

a K-length list of (B by n) matrices, where each matrices' rows refers to the values from a different bootstrap sample.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#use small n, small B, for a quick illustration
set.seed(0)
Y<-simEEG(n=100, centered=TRUE, wide=TRUE) 
svdY<-fastSVD(Y)
DUt<- tcrossprod(diag(svdY$d),svdY$u)
bInds<-genBootIndeces(B=50,n=dim(DUt)[2])
bootSVD_LD_output<-bootSVD_LD(DUt=DUt,bInds=bInds,K=3,verbose=interactive())

dsByK<-reindexVectorsByK(bootSVD_LD_output$ds)

boxplot(dsByK[[1]],main='Bootstrap distribution of 1st singular value')

bootSVD documentation built on Feb. 2, 2021, 5:06 p.m.