bootSVD_LD
Calculates the bootstrap distribution of
the principal components (PCs) of a low dimensional matrix.
If the score matrix is inputted, the output of
bootSVD_LD
can be used to to calculate bootstrap
standard errors, confidence regions, or the full bootstrap
distribution of the high dimensional components. Some users
may want to instead consider using bootSVD
,
which calls bootSVD_LD
, and also calculates
descriptions of the high dimensional components.bootSVD_LD(UD, DUt = t(UD), bInds = genBootIndeces(B = 1000, n =
dim(DUt)[2]), K, warning_type = "silent", talk = FALSE,
centerSamples = TRUE)
UD
. If both UD
and UDt
are entered and t(UD)!=DUt
, the
DUt
argument will override the UD
argument.B
is the number of bootstrap
samples, and n
is the sample size. Each row should
be an indexing vector that can be used to generate a new
bootstrap sample (i.e. sampl
qrSVD
, when
taking the SVD of the low dimensional bootstrap score
matrices.TRUE
will cause a
progress bar to appear.K
columns
of $A^b$, but all n
columns of $U^b$. The
results are stored as a list containingB
-length list of the (n
by K
) matrices
containing the first K
PCs from each bootstrap
sample. This list is indexed by b
, with the
$b^{th}$ element containing the results from the
$b^{th}$ bootstrap sample.B
-length
list of vectors, indexed by the bootstrap index b
,
with each vector containing the singular values of the
corresponding bootstrap sample.B
-length list, indexed by the bootstrap index
b
, of the ($n$ by $n$) matrices $U^b$.system.time
.bootSVD_LD
, the results
can be transformed to get the PCs on the original space by
multiplying each matrix $A^b$ by the PCs of the
original sample, $V$ (see As2Vs
). The
bootstrap scores of the original sample are equal to
$U^b D^b$.#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=200,n=dim(DUt)[2])
bootSVD_LD_output<-bootSVD_LD(DUt=DUt,bInds=bInds,K=3,talk=TRUE)
Run the code above in your browser using DataLab