Learn R Programming

bootSVD (version 0.1)

reindexDsByK: Allows for 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$).

Description

Allows for 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

reindexDsByK(dsByB)

Arguments

dsByB
a list of vectors, with each vector containing the n singular values from a different bootstrap sample.

Value

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

Examples

Run this code
set.seed(0)
Y<-simEEG(n=100, centered=TRUE, wide=TRUE)
svdY<-fastSVD(Y)
DUt<- tcrossprod(diag(svdY$d),svdY$u)
bInds<-genBootIndeces(B=200,n=dim(DUt)[2])
bootSVD_LD_output<-bootSVD_LD(DUt=DUt,bInds=bInds,K=3,talk=TRUE)

dsByK<-reindexDsByK(bootSVD_LD_output$ds)

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

Run the code above in your browser using DataLab