fastica: The Fast ICA (FASTICA)

View source: R/ica.R

fasticaR Documentation

The Fast ICA (FASTICA)

Description

The fast fixed point algorithm for independent component analysis and projection pursuit based on the direct translation to R of the FastICA program of the original authors at the Helsinki University of Technology.

Usage

fastica(
  X,
  components = NCOL(X),
  demean = TRUE,
  method = "symmetric",
  pca_cov = "ML",
  first_eigen = NULL,
  last_eigen = NULL,
  E = NULL,
  D = NULL,
  Z = NULL,
  K = NULL,
  L = NULL,
  A_init = NULL,
  fun = "tanh",
  tune = "none",
  tanh_par = 1,
  gauss_par = 1,
  step_size = 1,
  stabilization = FALSE,
  tol = 1e-04,
  maxiter = 1000,
  maxiter_fine = 100,
  sampling_ratio = 1,
  seed = NULL,
  trace = FALSE,
  ...
)

Arguments

X

the data matrix (n x m) where n is the number of samples and m is the number of signals.

components

the number of independent components to extract.

demean

whether to demean the data.

method

the method to use, with “symmetric” estimating all the independent component in parallel, whereas “deflation” estimates independent components one-by-one similar to projection pursuit.

pca_cov

the method used to calculate the covariance matrix for PCA. Options are “ML” (maximum likelihood), “LW” (Ledoit-Wolf) shrinkage method and “EWMA” (exponentially weighted moving average).

first_eigen

This and last_eigen specify the range for eigenvalues that are retained, first_eigen is the index of largest eigenvalue to be retained. Making use of this option overwrites components.

last_eigen

the index of the last (smallest) eigenvalue to be retained and overwrites component argument.

E

(optional) Eigen vector from the PCA decomposition. If this is provided then D must also be provided.

D

(optional) Eigen values from the PCA decomposition.

Z

(optional) provided whitened signal matrix. If this is provided then both K and L must also be provided.

K

(optional) whitening matrix.

L

(optional) de-whitening matrix.

A_init

optional initialization for the mixing matrix.

fun

the non-linear function to use in the fixed-point algorithm.

tune

the non-linear function to use for fine tuning.

tanh_par

control parameter for the “tanh” function.

gauss_par

control parameter for the “gauss” function.

step_size

if this is anything other than 1, the program will use the stabilized version of the algorithm (see stabilization argument).

stabilization

whether to use the stabilized version of the algorithm, in which case the step_size can momentarily be halved if the algorithm is stuck between two points (called a stroke). Additionally if there no convergence before half of the maximum number of iterations has been reached then step_size will be halved for the rest of the rounds.

tol

the stopping tolerance.

maxiter

the maximum number of iterations.

maxiter_fine

the maximum number of iterations for the fine tuning algorithm in the deflation method.

sampling_ratio

percent (0-1) of random samples used in one iteration

seed

the random seed for the random number generator.

trace

whether to print out progress information.

...

additional arguments to be passed to the covariance matrix calculation. For arguments passed to the “EWMA” method, it optionally takes an additional argument lambda which is the exponential decay parameter (default is 0.96). The “LW” takes an additional argument shrink which is the shrinkage parameter (default is to calculate this).

Details

Steps to the general algorithm are as follows:

  1. Demean the data if required: M = X - \mu

  2. Calculate the covariance matrix \Sigma using one of the methods provided.

  3. Use an eigen decomposition to calculate the eigenvalues and eigenvectors of the covariance matrix: \Sigma = E D E'

  4. Select the range of eigenvalues to retain (dimensionality reduction).

  5. Calculate the whitening matrix K = D^{-1/2}E' and the dewhitening matrix L = E D^{1/2}.

  6. Whiten the data: Z = M K'. Unwhitening is done by M = Z L'.

  7. Run the RADICAL algorithm to calculate the rotation matrix U, the mixing matrix: A = U^{-1} L and the unmixing matrix W = K' U.

  8. Calculate the independent components: S = M W + \bold{1}\mu W where 1 is a matrix of ones with dimension (samples x 1).

Notice that in calculating the mixing (A) and unmixing (W) matrices we have combined the whitening (K) and un-whitening (L) matrices with the rotation matrix U.

Value

A list with the following components:

A

the mixing matrix

W

the unmixing matrix

S

the independent components

U

the rotation matrix

K

the whitening matrix

L

the dewhitening matrix

C

the covariance matrix

Z

the whitened signal

mu

the mean of the mixed signal (X)

elapsed

the time taken to run the algorithm

References

\insertRef

Hyvarinen1999tsmarch


tsmarch documentation built on Nov. 2, 2026, 9:06 a.m.