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, X should be T timepoints by V brain locations.

Q

Number of latent dimensions to estimate. If NULL (default), estimated using PESEL (Sobczyka et al. 2020).

Q_max

Maximal number of principal components for automatic dimensionality selection with PESEL. Default: 100.

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)


[Package fMRItools version 0.4.7 Index]