An ICA algorithm based on an efficient entropy estimator (due to Vasicek) which is robust to outliers.

1 2 3 4 |

`X` |
The multidimensional signal matrix, where each column of matrix represents one observed signal. |

`n.comp` |
Number of independent components to estimate, defaults to the
dimension of the data (rows). Is overwritten by |

`demean` |
(Logical) Whether the data should be centered. |

`pca.cov` |
The method to use for the calculation of the covariance matrix during the PCA whitening phase. “ML” is the standard maximum likelihood method, “LW” is the Ledoit-Wolf method, “ROB” is the robust method from the MASS package and “EWMA” an exponentially weighted moving average estimator. Optional parameters passed via the ... argument. |

`k` |
The number of angles at which to evaluate the contrast function. The ICA contrast function will be evaluated at K evenly spaced rotations from -Pi/4 to Pi/4 |

`augment` |
Whether to augment the data (as explained in paper). For large datasets of >10,000 points this should be set to FALSE. |

`replications` |
This is the number of replicated points for each original point. The default value is 30. The larger the number of points in the data set, the smaller this value can be. For data sets of 10,000 points or more, point replication should be de-activated by setting augment to FALSE. |

`sd` |
This is the standard deviation (noise) of the replicated points when using the augmentation option. |

`firstEig` |
This and |

`lastEig` |
This is the index of the last (smallest) eigenvalue to be
retained and overwrites |

`pcaE` |
Optionally provided eigenvector (must also supply |

`pcaD` |
Optionally provided eigenvalues (must also supply |

`whiteSig` |
Optionally provided Whitened signal. |

`whiteMat` |
Optionally provided Whitening matrix (no.factors by no.signals). |

`dewhiteMat` |
Optionally provided dewhitening matrix (no.signals by no.factors). |

`rseed` |
Optionally provided seed to initialize the augmented data matrix. |

`trace` |
To report progress in the console, set this to |

`...` |
Optional arguments passed to the pca.cov methods. |

The interested reader should consult the paper in the references section for
details on the properties of the algorithm.

The algorithm is quite slow, despite partial implementation in C++, and should
only be used on small to medium sized sets.

A list containing the following values:

`A` |
Estimated Mixing Matrix (no.signals by no.factors). |

`W` |
Estimated UnMixing Matrix (no.factors by no.signals). |

`U` |
Estimated rotation Matrix (no.factors by no.factors). |

`S` |
The column vectors of estimated independent components (no.obs by no.factors). |

`C` |
Estimated Covariance Matrix (no.signals by no.signals). |

`whiteningMatrix` |
The Whitening matrix (no.factors by no.signals). |

`dewhiteningMatrix` |
The de-Whitening matrix (no.signals by no.factors). |

`rseed` |
The random seed used (if any) for initializing the mixing matrix A. |

`elapsed` |
The elapsed time. |

Erik G. Learned-Miller for the Radical algorithm and Matlab package.

Alexios Ghalanos for this R-port.

Learned-Miller, A.G and Fisher III, J.W., 2003, ICA Using Spacings Estimates of
Entropy, *Journal of Machine Learning Research*, **4**, 1271-1295.
http://www.cs.umass.edu/~elm/ICA/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ```
## Not run:
# create a set of independent signals S, glued together by a mixing matrix A
# (note the notation and matrix multiplication direction as we are dealing with
# row rather than column vectors)
set.seed(100)
S <- matrix(runif(10000), 5000, 2)
A <- matrix(c(1, 1, -1, 2), 2, 2, byrow = TRUE)
# the mixed signal X
X = S %*% t(A)
# The function centers and whitens (by the eigenvalue decomposition of the
# unconditional covariance matrix) the data before applying the theICA algorithm.
IC <- radical(X, n.comp = 2)
# demeaned data:
X_bar = scale(X, scale = FALSE)
# whitened data:
X_white = X_bar %*% t(IC$whiteningMatrix)
# check whitening:
# check correlations are zero
cor(X_white)
# check diagonals are 1 in covariance
cov(X_white)
# check that the estimated signals(S) multiplied by the
# estimated mxing matrix (A) are the same as the original dataset (X)
round(head(IC$S %*% t(IC$A)), 12) == round(head(X), 12)
# do some plots:
par(mfrow = c(1, 3))
plot(IC$S %*% t(IC$A), main = "Pre-processed data")
plot(X_white, main = "Whitened and Centered components")
plot(IC$S, main = "ICA components")
## End(Not run)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.