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. Most users may want to instead consider using bootSVD
, which also calculates descriptions of the high dimensional components. Note that bootSVD
calls bootSVD_LD
.
bootSVD_LD(UD, DUt = t(UD), bInds = genBootIndeces(B = 1000, n =
dim(DUt)[2]), K, warning_type = "silent", verbose = getOption("verbose"),
centerSamples = TRUE)
(optional) a (\(n\) by \(n\)) matrix of scores, were rows denote individuals, and columns denote measurements in the PC space.
the transpose of UD
. If both UD
and UDt
are entered and t(UD)!=DUt
, the DUt
argument will override the UD
argument.
a (\(B\) by \(n\)) matrix of bootstrap indeces, where 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. sample(n,replace=TRUE)
). The matrix of bootstrap indeces is taken as input, rather than being calculated within bootSVD_LD
, so that this method can be more easily compared against traditional bootstrap SVD methods on the exact same bootstrap samples. The bInds
matrix can be calculated using the helper function genBootIndeces
).
the number of PCs to be estimated.
passed to qrSVD
, when taking the SVD of the low dimensional bootstrap score matrices.
if TRUE
, a progress bar will appear.
whether each bootstrap sample should be centered before calculating the SVD.
For each bootstrap matrix \((DU')^b\), let \(svd(DU')=:A^b D^b U^b\), where \(A^b\) and \(U^b\) are (\(n\) by \(n\)) orthonormal matrices, and \(D^b\) is a (\(n\) by \(n\)) diagonal matrix \(K\). Here we calculate only the first K
columns of \(A^b\), but all n
columns of \(U^b\). The results are stored as a list containing
a B
-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.
a B
-length list of vectors, indexed by the bootstrap index b
, with each vector containing the singular values of the corresponding bootstrap sample.
a B
-length list, indexed by the bootstrap index b
, of the (\(n\) by \(n\)) matrices \(U^b\).
The computation time required for the procedure, taken using system.time
.
# NOT RUN {
#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())
# }
Run the code above in your browser using DataLab