RUNICA Perform Independent Component Analysis (ICA) decomposition of psychophysiological data using the infomax ica algorithm of Bell & Sejnowski (1995) with the natural gradient feature of Amari, Cichocki & Yang, the extended-ICA algorithm of Lee, Girolami & Sejnowski, PCA dimension reduction, and/or specgram() preprocessing (suggested by M. Zibulevsky).

Usage: >> [weights,sphere] = runica(data);
>> [weights,sphere,activations,bias,signs,lrates] = runica(data,'Key1',Value1',...);

Input:
data   
input data (chans,frames*epochs). Note that if data consists of multiple discontinuous epochs, each epoch should be separately baseline-zero'd using >> data = rmbase(data,frames,basevector);

Optional keywords:
'ncomps'   
[N] number of ica components to compute (default -> chans) using rectangular ica decomposition
'pca'   
[N] decompose a principal component (default -> 0=off) subspace of the data. Value is the number of PCs to retain.
'sphering'   
['on'/'off'] flag sphering of data (default -> 'on')
'weights'   
[W] initial weight matrix (default -> eye()) (Note: if 'sphering' 'off', default -> spher)
'lrate'   
[rate] initial ica learning rate (<< 1) (default -> heuristic)
'block'   
[N] ica block size (<< datalength) (default -> heuristic)
'anneal'   
annealing constant (0,1] (defaults -> 0.90, or 0.98, extended) controls speed of convergence
'annealdeg'   
[N] degrees weight change for annealing (default -> 70)
'stop'   
[f] stop training when weight-change < this (default -> 1e-6)
'maxsteps'   
[N] max number of ica training steps (default -> 512)
'bias'   
['on'/'off'] perform bias adjustment (default -> 'on')
'momentum'   
[0 0)
'extended'   
[N] perform tanh() "extended-ICA" with sign estimation every N training blocks. If N < 0, fix number of sub-Gaussian components to -N [faster than N>0] (default|0 -> off)
'specgram'   
[srate loHz hiHz frames winframes] decompose a complex time/frequency transform of the data (Note: winframes must divide frames) (defaults [srate 0 srate/2 size(data,2) size(data,2)])
'posact'   
make all component activations net-positive(default 'on'}
'verbose'   
give ascii messages ('on'/'off') (default -> 'on')

Outputs: [RO: output in reverse order of projected mean variance
unless starting weight matrix passed ('weights' above)]
weights   
ica weight matrix (comps,chans) [RO]
sphere   
data sphering matrix (chans,chans) = spher(data) Note that unmixing_matrix = weights*sphere {sphering off -> eye(chans)}
activations   
activation time courses of the output components (ncomps,frames*epochs)
bias   
vector of final (ncomps) online bias [RO] (default = zeros())
signs   
extended-ICA signs for components [RO] (default = ones()) [ -1 = sub-Gaussian; 1 = super-Gaussian]
lrates   
vector of learning rates used at each training step

Authors: Scott Makeig with contributions from Tony Bell, Te-Won Lee,
Tzyy-Ping Jung, Sigurd Enghoff, Michael Zibulevsky, CNL/The Salk Institute,
La Jolla, 1996-

See the matlab file runica.m (may require other functions)

Back to functions