dim_reduce {fMRItools} | R Documentation |
PCA-based Dimension Reduction and Prewhitening
Description
Performs dimension reduction and prewhitening based on probabilistic PCA using SVD. If dimensionality is not specified, it is estimated using the method described in Minka (2008).
Usage
dim_reduce(X, Q = NULL, Q_max = 100)
Arguments
X |
A numeric matrix, with each column being a centered timeseries.
For fMRI data, |
Q |
Number of latent dimensions to estimate. If |
Q_max |
Maximal number of principal components for automatic
dimensionality selection with PESEL. Default: |
Value
A list containing the dimension-reduced data (data_reduced
, a
V \times Q
matrix), prewhitening/dimension reduction matrix (H
,
a QxT
matrix) and its (pseudo-)inverse (Hinv
, a TxQ
matrix), the noise variance (sigma_sq
), the correlation matrix of the
dimension-reduced data (C_diag
, a QxQ
matrix), and the
dimensionality (Q
).
Examples
nT <- 30
nV <- 400
nQ <- 7
X <- matrix(rnorm(nV*nQ), nrow=nV) %*% diag(seq(nQ, 1)) %*% matrix(rnorm(nQ*nT), nrow=nQ)
dim_reduce(X, Q=nQ)