Independent Component Analysis using the FastICA algorithm (deflationary, logcosh nonlinearity).
More...
#include <ica.h>
|
| static IcaResult | run (const Eigen::MatrixXd &matData, int nComponents=-1, int maxIter=200, double tol=1e-4, int randomSeed=42) |
| static Eigen::MatrixXd | applyUnmixing (const Eigen::MatrixXd &matData, const IcaResult &result) |
| static Eigen::MatrixXd | excludeComponents (const Eigen::MatrixXd &matData, const IcaResult &result, const QVector< int > &excludedComponents) |
Independent Component Analysis using the FastICA algorithm (deflationary, logcosh nonlinearity).
Typical MEG/EEG usage:
QVector<int> exclude = {0, 3};
Result of an ICA decomposition.
static Eigen::MatrixXd excludeComponents(const Eigen::MatrixXd &matData, const IcaResult &result, const QVector< int > &excludedComponents)
static IcaResult run(const Eigen::MatrixXd &matData, int nComponents=-1, int maxIter=200, double tol=1e-4, int randomSeed=42)
Definition at line 98 of file ica.h.
◆ applyUnmixing()
| MatrixXd ICA::applyUnmixing |
( |
const Eigen::MatrixXd & | matData, |
|
|
const IcaResult & | result ) |
|
static |
Project new data through a previously fitted unmixing matrix. The same mean centering as during fitting is applied.
- Parameters
-
| [in] | matData | New data (n_channels x n_samples), same channel order as training data. |
| [in] | result | Result from a previous ICA::run() call. |
- Returns
- Source matrix (n_components x n_samples).
Definition at line 214 of file ica.cpp.
◆ excludeComponents()
| MatrixXd ICA::excludeComponents |
( |
const Eigen::MatrixXd & | matData, |
|
|
const IcaResult & | result, |
|
|
const QVector< int > & | excludedComponents ) |
|
static |
Reconstruct sensor-space data after suppressing selected components. The excluded component(s) are zeroed in source space before back-projection.
- Parameters
-
| [in] | matData | Original sensor data (n_channels x n_samples). |
| [in] | result | Result from ICA::run() on matData (or a representative segment). |
| [in] | excludedComponents | 0-based indices of components to suppress (e.g. ECG, EOG artifacts). |
- Returns
- Cleaned sensor data (n_channels x n_samples).
Definition at line 223 of file ica.cpp.
◆ run()
| IcaResult ICA::run |
( |
const Eigen::MatrixXd & | matData, |
|
|
int | nComponents = -1, |
|
|
int | maxIter = 200, |
|
|
double | tol = 1e-4, |
|
|
int | randomSeed = 42 ) |
|
static |
Fit FastICA on the given data matrix.
- Parameters
-
| [in] | matData | Input data (n_channels x n_samples). Each row is one sensor channel. |
| [in] | nComponents | Number of independent components to extract. Pass -1 (default) to use all channels. |
| [in] | maxIter | Maximum iterations per component (default 200). |
| [in] | tol | Convergence tolerance on |w_new · w_old| - 1 (default 1e-4). |
| [in] | randomSeed | Seed for the random weight initialisation (default 42). |
- Returns
- IcaResult containing mixing/unmixing matrices and source time series.
Definition at line 93 of file ica.cpp.
The documentation for this class was generated from the following files: