Description Usage Arguments Value Examples
View source: R/bootstrap_functions.R
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
.
1 2 3 | bootSVD_LD(UD, DUt = t(UD), bInds = genBootIndeces(B = 1000, n =
dim(DUt)[2]), K, warning_type = "silent", verbose = getOption("verbose"),
centerSamples = TRUE)
|
UD |
(optional) a (n by n) matrix of scores, were rows denote individuals, and columns denote measurements in the PC space. |
DUt |
the transpose of |
bInds |
a (B by n) matrix of bootstrap indeces, where |
K |
the number of PCs to be estimated. |
warning_type |
passed to |
verbose |
if |
centerSamples |
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
As |
a |
ds |
a |
Us |
a |
time |
The computation time required for the procedure, taken using |
If the score matrix is inputted to 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.
1 2 3 4 5 6 7 | #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())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.